Active
Project:
Nodequeue
Version:
7.x-2.1
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
29 Aug 2017 at 20:37 UTC
Updated:
31 Aug 2017 at 14:25 UTC
Jump to comment: Most recent
I upgraded nodequeue from version 2.0-beta1 to version 2.1. After upgrading my site couldn't find the function nodequeue_nids_visible. This function is in version 2.0-beta1. It is not in version 2.1 (or even 2.0, I checked). I can find no mention to the function being removed.
Here is the function as it exists in version 2.0-beta1
function nodequeue_nids_visible($sqid = -1, $account = NULL) {
$node_status_sql = '';
if (!$account) {
global $user;
$account = $user;
}
$nids_visible = array();
$query = db_select('node', 'n')
->fields('n', array('nid'))
->addTag('node_access')
->distinct()
->condition('nq.sqid', $sqid)
->orderBy('nq.position', 'ASC');
$query->leftJoin('nodequeue_nodes', 'nq', 'nq.nid = n.nid');
if (!user_access('administer nodes', $account)) {
$query->condition(db_or()->condition('n.status', 1)->condition('n.uid', $account->uid));
}
// Disable i18n_select for this query.
if (arg(0) == 'admin') {
$query->addTag('i18n_select');
}
$query_restricted = $query->execute();
foreach ($query_restricted as $result_restricted) {
$nids_visible[$result_restricted->nid] = $result_restricted->nid;
}
return $nids_visible;
}
Has it moved to another module? If so where? If not, can the function be added back into the nodequeue module?
Thanks in advance.
Comments
Comment #2
fizk commentednodequeue_nids_visible()was removed in #1871816: Node access checking is wrong. I'm not sure why Drupal is still trying to call that function.Can you try clearing the Drupal cache and if it issue continues, copy/paste the exact PHP error message?
Comment #3
kenrbnsn commentedI cleared the cache many times. That won't help if the function is not in the source. I looked (search in the editor & Linux grep). I will post the exact error message tomorrow when I have access to the machine where this happened.
Comment #4
kenrbnsn commentedHere is the error message I am getting (from the Apache logs)
PHP Fatal error: Call to undefined function nodequeue_nids_visible() [rest of message which refers to a custom module removed]Comment #5
fizk commentedCan you copy/paste the exact message. I need to see what was written where you have "rest of message which refers to a custom module removed".
Comment #6
kenrbnsn commentedHere is the whole error
Here is the code from the custom module with line 442 indicated:
BTW, I downloaded 7.x-2.0-beta1 and 7.x-2.0 to separate directories
When I do a
find . -type f | xargs grep -n nodequeue_nids_visiblein the beta1 directory, I get
When I do the same command in the 2.0 directory, the command doesn't find any lines.
The web site that's using this code hadn't been updated in quite a few years & I'm trying to bring it up to date. This missing function is a show stopper for my task, unless I revert back to the beta version.
Comment #7
fizk commentedThe patch in #1871816: Node access checking is wrong replaces the call to
nodequeue_nids_visible()with a call tonode_access('view', $node):Try using
node_access('view', $node)instead in /var/www/html/postaward/profiles/ruprof/modules/platform/platform.module on line 442.EDIT:
Actually, it looks like you want to use
_nodequeue_dragdrop_get_nodes(). We probably need a public facing function (no underscore) so that contrib modules can reliably expect to use them.