Hi been pulling my hair trying to get this module to work for anon users for unflagging content.
My set-up is I have a list of content being generated by a view in a page. I also have the default bookmarks view in a block on the same page. Everything works perfectly in firefox but in both IE8 and Safari 4 I can add nodes to my favourites list. When I try and remove them by either clicking the remove link on the page view or block, I get a error of javascript and cookies arent enabled.
When I'm on the bookmarks page the remove faves link works perfectly from both the page and the block.
I have flags 2.0 beta4 and tried with both session api stable and dev.
Anyone got ideas?
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | js_anon_order.diff | 1.02 KB | mooffie |
Comments
Comment #1
derjochenmeyer commentedI have the exact same problem.
Quick Fix: When disabling the Normal Page cache it works.
But we need the caching :-/
Comment #2
derjochenmeyer commentedI investigated more and found out that "sometimes" the the flag links dont get the
?has_js=1query string attached.Without this query string the links return a javascript error.
This Javascript snippet fixes the problem for me (quick & dirty):
I use Firefox 3.6.12 on Windows XP
Comment #3
Rene Hostettler commentedHi derjochenmeyer
Awesome that fixed it for me! Thanks heaps, have tested it in IE8 and safari 4
Comment #4
mooffie commented(Jochen, thank you for finding a solution. I'm currently busy with other Flag issues so I haven't looked into this yet.)
Comment #5
derjochenmeyer commentedThis needs to be fixed at the root. I dont know enough about the inner mechanics of flag to solve the problem, but maybe this helps to trace the bug...
This only happens for me with the normal page cache enabled.
Marking this as critical because it breaks one of the Key features for 2.x branch:
Comment #6
mooffie commentedI seem to have found the problem. (And contrary to the OP's report, this bug affects Firefox as well.)
Our JavaScript code currently does these two things, in this order:
has_js=1to the links.The bug is in the order: the addition of
has_js=1is done first, but it immediately gets overwritten by the second step.The solution is to reverse the order. I'm attaching a patch.
Comment #7
mooffie commentedCommitted.
http://drupal.org/cvs?commit=462398
http://drupal.org/cvs?commit=462400
(Let me know if it doesn't solve your problem.)
Comment #8
derjochenmeyer commentedPatch #6 solved this issue for me.
Comment #10
kenorb commentedPlease follow: #839082: Problems with Anonymous Users Flagging (JS variables not added to the page in time)