Can't delete comments in "Comment Moderation Queue"

This is the place to discuss bugs that have been found in the most recent version of PivotX. Posting bugs will ensure that the Development Team is aware of them and that they will be addressed when resources are available.

Can't delete comments in "Comment Moderation Queue"

Postby ITI » Thu Dec 29, 2011 10:53 pm

Version: 2.3.1
Entries & Pages >> Moderate Comments >> "Comment Moderation Queue"
When you click the delete button associated with a comment you get the server side error message:
There was a problem with the Database:

error code 0:

If you're in the process of setting up PivotX, you should review your Database connection settings.
If it worked before, you should check if the Mysql database engine is still running on the server (or ask your systems administrator to check for you).


If you then return to the Moderation Queue you will see the message is still there.

Cause: There is a typo in file "pivotx/templates_internal/moderatecomments.tpl" Line 81, character 139:

<a href="#" onclick="return confirmme('index.php?page=comments&amp;uid=[[ $comment.entry_uid ]]&amp;del=[[ $comment.uid ]]amp; <<< typo ...

Add the character "&" in front of "amp;" >>> It should now read ";del=[[ $comment.uid ]]&amp;"
(the "&" (ampersand) is the character above number 7 on the key board)
Code: Select all
<a href="#" onclick="return confirmme('index.php?page=comments&amp;uid=[[ $comment.entry_uid ]]&amp;del=[[ $comment.uid ]]&amp;return=moderatecomments', '[[t escape=js ]]Delete this comment?[[/t]]');" class="negative">

...
Issue #2
The same server side error message will also appear if you click on the buttons "Approve comments" or "Delete comments" and haven't checked any items.
Cause: User didn't check any items.
Recommendation: Add client side validation.
The following could be added to "pivotx/includes/js/pivotx.js"

Code: Select all
/**
 * Checks to see if the checkbox has been checked.
 * Loops through checkbox tags with the same name and returns true if any one has been checked.
 *
 * @param String cbname The checkbox element's name.
 * @return Bool False if none of the check boxes have been checked.
 */
function hascheckeditems(cbname){
  var ret = false;
  var x=document.getElementsByName(cbname);
  for(i=0;i<x.length;i+=1){ if(x[i].checked){ret = true; break;}}
  if(!ret) { alert("Nothing Selected"); }
  return ret;
}

And to "pivotx/templates_internal/moderatecomments.tpl" line 6, add the text in red:
<form action="index.php?page=comments" method="post" onsubmit="return hascheckeditems('checked[]')">
Code: Select all
<form action="index.php?page=comments" method="post" onsubmit="return hascheckeditems('checked[]')">

The user will get an alert saying "Nothing Selected" rather than the database error message which is inaccurate and confusing.
It threw me off the first time it happened to me as I suspect it would for others.

I wrote the function so it could be used else where in pivotx if it were necessary to confirm the "checked" status of a checkbox by passing in the tags "name".
...
I hope this has been useful.
Glen
ITI Internetworking Technologies Inc.
ITI
 
Posts: 7
Joined: Wed Dec 28, 2011 7:01 pm
Location: Edmonton, Alberta, Canada

Re: Can't delete comments in "Comment Moderation Queue"

Postby hansfn » Fri Dec 30, 2011 11:09 am

Hi, Glen. Thx a lot for the detailed bug report here and in the "New Install bugs" post. The timing of your posts are excellent since we plan to release a new version soon. I'm always surprised that so many bugs can be present without being reported (or discovered by the dev team).

Feel free to save some typing by making the reports a little more concise - the dev team understand what you mean and most users want won't be able to fix things themselves anyway.

PS! Are you reviewing all CMS's this closely? We really appreciate it :-)

Added: The issues you reported above were just fixed in revision 4027. (This also fix an issue with the editing of comments in the moderation queue.)
hansfn
Developer
 
Posts: 3282
Joined: Sun Nov 25, 2007 7:48 pm
Location: Molde, Norway

Re: Can't delete comments in "Comment Moderation Queue"

Postby ITI » Fri Dec 30, 2011 2:40 pm

Hi Hansfn

Feel free to save some typing by making the reports a little more concise - the dev team understand what you mean and most users want be able to fix things themselves anyway.
I suppose you are right. I guess I'm thinking that users are going to want to edit and make the corrections rather than wait for a new release. And yes, the detail is meant to help the end users not just the dev team.

PS! Are you reviewing all CMS's this closely? We really appreciate it

No, not all. I have been reviewing quite a few PHP Blogging packages this past week in an effort to determine which one to recommend to my customers.
My review is to determine if there is good documentation, an easy to understand admin section, forum support and from my perspective how receptive and quickly the Dev team responds to a bug report.

Although I had some issues with the install they were fairly easy to diagnose and it would be a shame not to tell you about them or at least where to look to resolve them. It also tells me how effective your forum support is going to be.

I quite like what you people have done but you will find that my contributions will be sporadic. I can't be working with it on a daily basis but if an issue or error pops up I will usually provide a recommendation and/or the code fix required. I feel that this is the least I can do if I going to use your software.

Happy holidays...
Glen
ITI Internetworking Technologies Inc.
ITI
 
Posts: 7
Joined: Wed Dec 28, 2011 7:01 pm
Location: Edmonton, Alberta, Canada

Re: Can't delete comments in "Comment Moderation Queue"

Postby ITI » Thu Jan 05, 2012 7:42 pm

Hi Hans

I just installed the 3 files you updated in revision 4027.
The buttons are still clickable if nothing has been checked. (Although there are no errors)
Are there more than the 3 files mentioned in 4027 to make the buttons dimmed when nothing has been checked as indicated in your 4027 comments?

Also, wouldn't it be better to return the user to the Moderation Que if it is "not" empty rather than the Comments tab/directory?
The issue of items not being checked wouldn't matter if that were the case. Going to the Comments window implies successful Approval/Deletion of the items.
Glen
ITI Internetworking Technologies Inc.
ITI
 
Posts: 7
Joined: Wed Dec 28, 2011 7:01 pm
Location: Edmonton, Alberta, Canada

Re: Can't delete comments in "Comment Moderation Queue"

Postby hansfn » Fri Jan 06, 2012 8:08 am

The buttons are still clickable if nothing has been checked. (Although there are no errors)

That is correct. My commit message was trying to make it clear that your suggestion wasn't implemented because we plan to fix in another way.

Also, wouldn't it be better to return the user to the Moderation Queue ...

Definitely - independent of the queue being empty or not. It's a short-coming of the current approach. It will be fixed eventually.
hansfn
Developer
 
Posts: 3282
Joined: Sun Nov 25, 2007 7:48 pm
Location: Molde, Norway


Return to 2.x Bugs

Who is online

Users browsing this forum: No registered users and 1 guest

cron