Administrators see add/remove links for all subqueues to which they have access. There should be a configurable option to reduce the number of add/remove links that administrators see, as this could become overwhelming when there are thousands of user subqueues.

This was discussed in #294536: Using admin login. Multiple instances of Add to on bottom of node.

Comments

ezra-g’s picture

Priority: Normal » Critical

Bumping priority: This is critical for sites with 1000's of users.

ezra-g’s picture

Status: Active » Needs review
StatusFileSize
new2.83 KB

This patch adds a configurable option to hide add/remove links from administrators. If you're not familiar with appling/testing patches, please let me know. Thanks!

satcom74’s picture

StatusFileSize
new171.78 KB
new61.85 KB
new29.71 KB

I applied the patch and it works as far as not showing Add to and Remove from links for every user. So far every thing seems to be working as far as users adding to and removing from the queue. I did notice that on the admin login only, when admin goes and clicks the Node Queue Icon or link he gets the following error.

* warning: array_keys() [function.array-keys]: The first argument should be an array in /var/www/drupal/modules/nodequeue/nodequeue.module on line 2036.
* warning: implode() [function.implode]: Bad arguments. in /var/www/drupal/modules/nodequeue/nodequeue.module on line 2036.
* user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') AND nid = 47 GROUP BY sqid' at line 1 query: SELECT sqid, MIN(position) AS position FROM nodequeue_nodes WHERE sqid IN () AND nid = 47 GROUP BY sqid in /var/www/drupal/includes/database.mysql.inc on line 172.
* warning: Invalid argument supplied for foreach() in /var/www/drupal/modules/nodequeue/nodequeue.module on line 408.

This isn't urgent for me in that in my case admin will not be administering these user smartnodes. But, if that is breaking other nodequeues like for other admin-administered content, I could see where that would be a problem.

I'm attaching the following images:
Admin logged in before patch clicking Node Queue icon that is with each teaser. (In my example it is labeled My Favorites)
Admin logged in after patch showing error.
Admin logged in looking at teasers showing that the Add to and Remove from icons are gone.

ezra-g’s picture

Thanks for this review.

Do you by any chance have the dev version of smartqueue_og installed ;). That could be causing this error and in fact it's the only way I was able to reproduce it. It seems to be caused when one visits the nodequeue tab on a node that actually cannot belong to any queues, and therefore shouldn't have a tab.

If you clear the menu cache, does the nodequeue tab (and the error) disappear?

satcom74’s picture

I'm not using the smartqueue_og module. I cleared the cache_menu table in mysql. Is that sufficient? I'm still getting the error.

ezra-g’s picture

OK, let's get to the bottom of this:

Could you please open up nodequeue.module and after line 2035, " function nodequeue_set_subqueue_positions(&$subqueues, $nid) { "

add the following snippet so that ithe first 3 lines of that function look like this:
[corrected for a typo]

function nodequeue_set_subqueue_positions(&$subqueues, $nid) {
  if (!$subqueues){
    drupal_set_message("<pre>". print_r(debug_backtrace(), TRUE)  ."</pre>");
  }
 

or if you have devel.module installed and enabled:

function nodequeue_set_subqueue_positions(&$subqueues, $nid) {
  if (!$subqueues){
    drupal_set_message(dprint_r(debug_backtrace(), TRUE));
  }

Then, visit a page that generates one instance of those errors and paste the output here. Thanks!

ezra-g’s picture

In the meantime, or if you're unable to do that in the near future, can you clarify a few things about what yous said,

. I did notice that on the admin login only, when admin goes and clicks the Node Queue Icon or link he gets the following error.

Which permissions does that admin login have assigned to his role? Please list all nodequeue and smartqueue_users permissions.

Since I'm having trouble reproducing the error, you said "icon or link" -- Since nodequeue has no icon, do you mean either the add/remove links or the nodequeue tab?

ezra-g’s picture

Actually, this error looks like the same one that you reported in #294167: Getting the following error when I actually add a node to queue. Could it be the same problem with your setup that you were experiencing there?

ezra-g’s picture

StatusFileSize
new2.83 KB

Patch no longer applies. Is re-rolled here for that reason, not to address the errors reported by satcom74.

ezra-g’s picture

Version: 5.x-0.4 » 6.x-1.x-dev
Status: Needs review » Patch (to be ported)

Committed to 5.x.

ezra-g’s picture

Status: Patch (to be ported) » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.