I've just updated to 2.11 but this also started happening with the previous version. The nodequeue is set up to only allow one content type to be added. For some reason when attempting to add a valid node, it gives the following error

user warning: You can't specify target table 'nodequeue_nodes' for update in FROM clause query: INSERT INTO nodequeue_nodes (sqid, qid, nid, position, timestamp) VALUES (1, 1, 139, IFNULL((SELECT MAX(position)+1 FROM (SELECT * from nodequeue_nodes WHERE sqid = 1) as nn), 1), 1319107523) in /home/witch944/public_html/sites/all/modules/nodequeue/nodequeue.module on line 1041.

CommentFileSizeAuthor
#2 nodequeue problem.jpg54.58 KBAnonymous (not verified)
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

amateescu’s picture

Status: Active » Postponed (maintainer needs more info)

Hmm, seems weird that things 'suddenly' stop working :)

Have you done any other upgrades or custom development before this error started to appear? And what do you mean by 'valid node', how could you add an invalid node if you already said that only one content type is selected?

This might me a longshot, but cat you try this patch: http://drupal.org/files/nodequeue-290969-37b.patch ? It's 37b from #290969-37: Postgres compatibility and it touches the query from line 1041.

Anonymous’s picture

FileSize
54.58 KB

Hi

By "valid node", I mean a node that is of the content type that is selected in the nodequeue settings.

It seems that upgrading to the 2.11 version caused the problem. I've rolled back to 6.x-2.10 and am able to add nodes as before.

I see the insert query in nodequeue_subqueue_add has been changed in the 2.11 release, so there seems to be a situation where it breaks. I have 1 subqueue containing 1 node. A screenshot of the contents in nodequeue_nodes table is attached.

I'm using MySQL 4.1.22

amateescu’s picture

Assigned: Unassigned » amateescu
Category: support » bug
Status: Postponed (maintainer needs more info) » Active

I will take a look at the change in nodequeue_subqueue_add() in a few days.

amateescu’s picture

Status: Active » Closed (duplicate)

I believe this was fixed by #290969: Postgres compatibility. Can you please try with tomorrow's 6.x-2.x-dev release and reopen if needed.

Or, if you can't upgrade your mysql version, it's perfectly fine to stay with 6.x-2.10 if you don't need the bugfixes that went in 6.x-2.11.

hirbys’s picture

I also was bitten by this bug a few minutes ago. After upgrading to 6.x-2.x-dev, the error remained, and the node was not added to the queue. I reverted to 6.x-2.10 and the queue is working again. I'm running MySQL 4.1.22.

hirbys’s picture

Status: Closed (duplicate) » Active

Changing status back to active. Sorry for the additional comment.

nevets’s picture

I am also using the dev version and getting the error.

No matter what I tried I would get the error till I broke it into two lines

	$new_position = db_result(db_query("SELECT MAX(position) FROM {nodequeue_nodes} WHERE sqid = %d", $subqueue->sqid)) + 1;
	db_query("INSERT INTO {nodequeue_nodes} (sqid, qid, nid, position, timestamp) VALUES (%d, %d, %d, %d, %d)", $subqueue->sqid, $queue->qid, $nid, $new_position, time());

Site using mySql 4.1.22

Anonymous’s picture

I'm still getting the error on the dev version

user warning: You can't specify target table 'nodequeue_nodes' for update in FROM clause query: INSERT INTO nodequeue_nodes (sqid, qid, nid, position, timestamp) VALUES (1, 1, 17, COALESCE((SELECT MAX(position)+1 FROM (SELECT * from nodequeue_nodes WHERE sqid = 1) as nn), 1), 1331459130) in /home/witch944/public_html/sites/all/modules/nodequeue/nodequeue.module on line 1042.

I can confirm that splitting it into two lines fixes the error for me as well.

Anonymous’s picture

Any chance of getting this committed into a release?

Anonymous’s picture

nudge...

helmo’s picture

Issue summary: View changes
Status: Active » Fixed

This works in the 7.x-2.0 release - https://www.drupal.org/node/2501755

Status: Fixed » Closed (fixed)

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