Hi everybody, I have the following situation with Flag 6.x-2.0-beta5 and Session API 6.x-1.4:
- I created a flag called "like"
- permission to flag and unflag is granted to anon and authenticated users
- un-/flagging is done by ajax
- the flag is configured to not show on node teasers and node pages
- output is done with print flag_create_link('like', $node->nid); in node template files
- Drupal "normal" cache is activated
We encounter several effects when flagging / unflagging, independent of which browser brand we use:
I. First click does not change the displayed flag count (anon & auth)
Often after you hit a flag you get the visual feedback (I disabled message display) that the system recognized the click (the flag disappears and instantly reappears) but it displays the same count as before. Only when I click a second time the action seems to trigger and the flag count goes one point up / down.
II. Flag gets it all wron on subsequent click (anon only)
If I encountered the problem described in I. and do a third click, the count often goes down two points.
Example (all done without in-between page loads):
- node has a "like" flag count of 1
- anon user hits the flag once - flag count disappears and immediately reappears but stays at 1
- anon user hits the flag a second time - flag count goes up to 2
- anon user hits the flag a third time - flag count goes down to 0!
- anon user hits flag a fourth time - flag count goes up to 1
- subsequent flag hits only switch between 1 and 0
I thought it may have to do with the fact that I test the site as anon user and with two different accounts and flag and / or session api gets confused by switching accounts or being anonymous with the same session api session (as I understand it and verified with the firebug firecookie plugin, the session api cookie is the same no matter what). But even that would not explain why nothing seems to change on first click and why I'm able to change the flags value by two with one click.
You may check the behaviour by yourself on the following site: http://www.digital-room.de/
Comments
Comment #1
Anonymous (not verified) commentedAdditional info:
On first click the flags cookie gets correctly set to like_NID, but as stated above, the displayed value stays the same.
Comment #2
quicksketchI can't confirm this issue with the latest version of Flag and your site now looks fine also. Did you have to do anything to get it working on your site? It would be helpful to know what (if anything) you did to get it working for other users who may have the same issue in the future.
Comment #3
Anonymous (not verified) commentedSorry for not dating you up. That particular bug got handled by another dev shop. I'm gonna point them to this issue to explain how they fixed it.
Comment #4
aschiwi commentedThis was a really hard bug to fix. We finally solved it back in May using dev versions of flag and session_api as well as the patch from http://drupal.org/node/719616#comment-3033036.
Comment #5
quicksketchHm, okay. Considering there are a ton of fixes in the latest version of the module (we made a new official release just yesterday) and #719616: Keep flag_counts current by manual in/decreasing of count. is on the slate for inclusion shortly, and I can't reproduce this issue anyway, let's close this one. Please reopen if the latest version still causes you troubles or if there's an easy way to reproduce this issue.
Comment #6
quicksketchThanks also guys for the follow up, I really appreciate the feedback.