Hi,
I have somehow managed to add a ndoe twice to the same nodequeue. on the nodequeue page it is only seen once, but on the actual view, it is shown twice. Removing the item from the nodequeue removes it from the nodequeue page and one instance from the view,but not the other.
Any ideas?
| Comment | File | Size | Author |
|---|---|---|---|
| #27 | basic.js_.hide_.txt | 1.24 KB | ezra-g |
Comments
Comment #1
naheemsays commentedok, it seems like I may have figured this out.
removing an item from a nodequeue is currently NOT deleting the row from the database table - it is just setting the sqid to 0.
On the nodequeue page, this items will not be shown, but in a view, it will be as that does not filter out those with an sqid = 0.
Leavign priority as normal, but I would say it is more than that as this bug removes a lot oft eh functionality of nodequeue.
Comment #2
ezra-g commentedThanks for your detailed report.
I'm unable to recreate this. Testing with user with "manipulate queues" permission and a standard single node queue, there is no duplicate entry in the database. It sounds like you're saying that sqid is getting set to 0 in nodqueue_nodes, correct?
Can anyone else recreate this issue?
Comment #3
naheemsays commentedyes - on the delete action, instead of removing the full record, just sqid seems to get set to 0, and nodequeue ignores the record. However, views does not.
(the user had both "manipulate queues" and "manipulate all queues" permission. )
Comment #4
ezra-g commentedDoes it set the sqid of all nodes in the subqueue to 0, or just the node that was removed?
Are you using mysql?
Can you recreate this with a fresh Drupal install with the latest nodequeue RC?
Comment #5
naheemsays commentedJust the node to be deleted in mysql. I will test on a fresh install and give further results.
Comment #6
naheemsays commentedhm... not getting this on a clean install without other modules... could it be an issue with memory useage?
Comment #7
ezra-g commentedI'm not sure how memory usage would cause this to happen. The query for removing a node from a subqueue doesn't update the entry for the node being removed, it just deletes the entry from nodequeue_nodes. In #5, you used the word delete. Just to be clear, we're talking about removing nodes from a subqueue, not deleting nodes that are in a queue, right?
Do you have modules enabled on your problematic install that interact with nodequeue?
Comment #8
naheemsays commentedJust views.
I mean remove the item from the nodeqeue - specifically clicking the text "remove from x" which is set in the nodequeue settings page.
On the site with the problem (which incidentally is live - I do crazy things), it does not remove the entry from nodequeue_nodes, just sets the sqid = 0. This worked properly with rc1.
sorry about the confusing language.
Comment #9
ezra-g commentedIs this happening on a fresh install?
Comment #10
naheemsays commentednope. I think it is no longer happening no the old install either. Either that, or the user with permissions is working around the issue.
Comment #11
ezra-g commentedMarked #320315: Cannot cleanly remove node from queue as a duplicate of this issue. Please see that issue for more information.
At this point it would be great if someone who is experiencing this problem could provide:
1) the result of a debug_backtrace() from nodequeue_subqueue_remove_node() when removing a node from a queue results in its entry in nodequeue_nodes having an NID of 0
2) The results of the following query: "SELECT * FROM {nodequeue_nodes};"
Comment #12
ezra-g commentedIf you're unwilling or unable to provide this information, I could help guide you through the steps necessary to procure it, or you could grant me database, command line and browser access to the Drupal installation where you are having this issue and I can look at it myself.
Comment #13
naheemsays commentedI can no longer reproduce this problem.
Comment #14
billybob4 commentedHi,
I don't really understand how to provide what you're asking for in #1.
If you can tell me how to do it I'll provide.
#2:
mysql> select * from nodequeue_nodes;
+-----+------+------+----------+------------+
| qid | sqid | nid | position | timestamp |
+-----+------+------+----------+------------+
| 1 | 1 | 21 | 9 | 1223838481 |
| 1 | 1 | 20 | 8 | 1223838481 |
| 1 | 1 | 17 | 7 | 1223838481 |
| 1 | 1 | 18 | 6 | 1223838481 |
| 1 | 1 | 19 | 5 | 1223838481 |
| 1 | 1 | 22 | 4 | 1223838481 |
| 1 | 1 | 23 | 3 | 1223838481 |
| 1 | 1 | 0 | 2 | 1223838481 |
| 3 | 3 | 0 | 1 | 1223833299 |
| 3 | 3 | 34 | 2 | 1223833687 |
| 2 | 2 | 0 | 1 | 1223424742 |
| 1 | 1 | 0 | 1 | 1223838481 |
+-----+------+------+----------+------------+
12 rows in set
Comment #15
ezra-g commentedThanks for helping here!
In order to pursue this, please:
delete all entries from the nodequeue_nodes table where the sqid is 0.
"DELETE FROM {nodequeue_nodes} WHERE sqid = 0;"
Then try clicking an "add to queue" link. Check the nodequeue_nodes table again. Is a new entry created with a sqid of 0?
If not try manipulating a queue and using either the "move to front" or "move to back" buttons. Does this create a value with a sqid of 0?
Thanks!
Comment #16
ezra-g commentedTo clarify, both users on this thread reported that it appears as though the invalid entries in nodequeue_nodes are being created when a node is removed. I suspect that these values may be getting created when nodes are moved or entered into a queue, since the removal of a node from a queue doesn't ever modify or create a sqid value.
(sorry about the mail spam)
Comment #17
billybob4 commentedSorry for the length of this post
None of my nodequeue_nodes records have sqid of 0. It is the nid value that has been set to 0.
Following are the results of a series of actions that might help.
before removing nodes:
remove nodes with nid of 0:
after removing nodes:
after adding a new node (nid 32) to the queue:
(8 nodes show up in site admin view (quid 1) - correct)
after moving new item to top of nodequeue:
(only 7 nodes show up in site admin view and front end - 8th node now has an id of 0 after this nodequeue order change)
move a different node to top of nodequeue:
(7 nodes show up in site admin view and front end - 8th node has an id of 0. No new record with a nid of 0 despite the second nodequeue order change)
after delete a node (nid 32) from the queue using site admin:
set record with nid 0 to correct nid (20)
Now its tidy with 7 nodes in 1 queue, each with a unique position, starting with 1
used site admin to move nid 19 up one place (I have reverse view selected btw):
** where has this 8th record come from? it has a nid of 0 (so you are correct, is does happen on an order change)
Comment #18
ezra-g commentedOk, great. Thanks for this troubleshooting :D!
I think we're close to targeting and solving the problem. I'll pursue this more -- Your troubleshooting steps and being able to see your whole nodequeue_nodes table will make it easier for me to create the conditions that result in this error.
Comment #19
billybob4 commentedgreat stuff. let me know if I can help any further.
thanks
Comment #20
ezra-g commented@nbz: Was the queue in question using the "Reverse in admin view" option?
Comment #21
ezra-g commentedActually, it probably doesn't matter if you have reverse queues enabled. I've been squeezing this issue in between other things this week but I should have some more dedicated time to devote to it this weekend. In the meantime, I suspect the problem is related to line ~1105 in nodequeue_arrange_subqueue_form_submit,
$args[] = $nids[$old_pos];Comment #22
naheemsays commentedYes it was. I will try to reproduce/help out later today/tomorrow.
Comment #23
ezra-g commentedDo each of you/your clients have javascript enabled or disabled in the browser? This could be a related factor.
Again, I'll get at this in more depth this weekend.
Comment #24
naheemsays commentedenabled.
and I appreciate you looking into this. It is tricky.
Comment #25
billybob4 commentedMy queue was reversed view yes, and javascript has never been disabled
Comment #26
ezra-g commentedbillybob4 reported that he is using firefox 2 on WinXP. nbz: what is your browser and OS?
Comment #27
ezra-g commentedbillybob4's problem was being caused by custom javascript in a custom theme. billybob4 gave me access to the machine where this problem was occurring. I added
in nodequeue.module around line 1098 (after
) in nodequeue_arrange_subqueue_form_submit.
With javascript enabled, after rearranging the queue and submitting the form, this would output two arrays of new and old queue position values and nids, like this:
In this case, I saw
indicating that javscript had been entered as a value in the order array. $order is taken from the form values, so the javascript in question resulted in javascript being injected into the form.
These arrays are used to determine values inserted in the nodequeue_nodes table.
I identified the suspected javascript file and renamed it from basic.js to basic.js.hide and after reloading the page, this error was eliminated.
nbz: are you using any custom javascript?
The javascript file implicated is attached to this issue for reference.
I performed this troubleshooting in Firefox 3 on Mac OS X 10.4.11 .
Comment #28
ezra-g commentedI'd like to hear from nbz, but it seems like the least that could be done here to improve the module would be to prevent these bad values from getting saved.
Comment #29
naheemsays commentedI was using Firefox 3 on Vista - How do I test this javascript stuff?
As for the theme - it has been customised from 4seasons, but contains to javascript in it - I removed the bits that were in the original theme as I did not need them.
I am testing all this on my test server right now, but cannot reproduce - I have also email another user who suffered from the same problem to she if she has better "luck" reproducing it - My previous work around was to simple tell her to not do things the way she was.
EDIT - just attempted various things on a live site and still could not break it. Grrr!
Comment #30
naheemsays commentedand the other user can no longer reproduce it either. Sorry.
Comment #31
ezra-g commentedMarking as fixed and opened a new task to prevent this from happening in the future #337834: Prevent bad data from being saved to nodequeue_nodes
Comment #32
ezra-g commented