On lines 342-344 of nodequeue.module, in the nodequeue_apachesolr_update_index() function, subqueues are retrieved with nodequeue_get_subqueues_by_node() and then nodequeue_set_subqueue_positions() is called with the subqueues as an argument. The problem is, nodequeue_set_subqueue_positions() blows up if the list of subqueues is empty. For example, when indexing, I would get errors like this from nodequeue_set_subqueue_positions():
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 = 110380 GROUP BY sqid' at line 1 query: SELECT sqid, MIN(position) AS position FROM nodequeue_nodes WHERE sqid IN () AND nid = 110380 GROUP BY sqid in /var/shared/sites/211sandiego/site/sites/all/modules/nodequeue/nodequeue.module on line 2394
To avoid there errors, I just ensure $subqueues is not empty before calling nodequeue_set_subqueue_positions(). Here is a patch.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | 540810.patch | 674 bytes | ezra-g |
| hook_apachesolr_update_index_fix.patch | 828 bytes | jpmckinney |
Comments
Comment #1
jpmckinney commentedComment #2
ezra-g commentedThanks for this patch.
Would it work for your use case to simply make nodequeue_set_subqueue_positions not explode when $subqueues is empty?
The attached patch implements this.
Comment #3
ezra-g commented...and here's the patch.
Comment #4
ezra-g commentedI committed the later version of this patch. Thanks!
Comment #5
jpmckinney commentedLooks good. Thanks!