Closed (fixed)
Project:
Flag
Version:
7.x-3.x-dev
Component:
Flag core
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
2 Mar 2014 at 16:42 UTC
Updated:
28 Mar 2014 at 05:11 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
joachim commentedWe can use the same change record for this as #2154251: Flag status incorrect when flagging another flag as a reaction to unflagging (Javascript), https://drupal.org/node/2210055
Comment #2
joachim commentedGot a local branch for this about ready to do; will make patch soon.
Comment #3
joachim commentedIncludes docs for all the flag_*_count() functions.
Follow-up: #2212727: add detail on flag counts to Rules actions.
Comment #4
joachim commentedComment #5
joachim commentedThis causes a lot of changes to the API functions. Here's the data that the test gathers from them -- the keys are the names of the API functions, the values the data they return when called during the hook invocation.
During a flagging, hook_entity_insert() and hook_flag_flag():
During an unflagging, hook_flag_unflag(), hook_entity_delete():
Note that not all flag_get_foo_counts() functions behave the same way -- some don't get updated data in an unflagging because they query the flagging table rather than flag_counts.
Comment #6
joachim commentedComment #7
shabana.navas commentedHave updated #2212727: add detail on flag counts to Rules actions and added details to the affected Rules functions as well.
Comment #8
joachim commentedIssue #2208847 by joachim: Fixed static caches of Flag API not getting reset when flagging and unflagging.
Thanks for the review!
Off to update the change record now.
Comment #9
joachim commentedNot pushed this yet, as getting myself tied in knots with the CR.
Above, I pasted that during unflagging, the old behaviour was:
but in my notes for the CR, I have 0s for those. That would be a regression! Need to do more investigating...
Comment #10
joachim commentedOk, panic over. My notes were wrong; the comment above has the correct data.
Comment #11
joachim commentedhttps://drupal.org/node/2210055 updated.
Comment #12
shabana.navas commentedGreat!