As part of #2208847: flag_get_FOO_counts() API functions do not have their static caches reset when (un)flagging, I'm adding docs to the various flag API functions that return counts, to explain what count you get back when you call them during a flagging or unflagging.

This information should be reflected in the Rules UI too, if it's possible to do it succinctly. We have several Rules actions that fetch counts, and people appear to be fond of using flag counts in Rules triggered by flaggings.

Comments

shabana.navas’s picture

Status: Active » Needs review
StatusFileSize
new1.37 KB

Added documentation to the relevant Rules functions to clarify the type of count that the user will get back during a flagging/unflagging.

joachim’s picture

Ah, sorry, I wasn't clear -- I meant in the texts that show in the UI. I imagine that people who are using Rules to say 'If this flag count is 6 or higher' don't read the code :(

Hence why I didn't do it in the other issue and filed a follow-up, as it requires a little investigation of the Rules API.

shabana.navas’s picture

Ah! I see what you mean now. Need to come up with some precise text for that in the UI. Will post shortly.

shabana.navas’s picture

Okay, added the new text to the UI. This will appear on the Fetch Entity Flag Count, Fetch User Flag Count, Fetch Overall Flag Count actions. Patch is attached. A screen shot is also attached.

shabana.navas’s picture

Had some spacing issues, posting the patch again.

shabana.navas’s picture

Grr!! Forgot the conditions, posting a new patch.

joachim’s picture

Thanks for tackling this!

In light of #2217487: ambiguous language in flag count docs, I've reworded the new texts. Also fixed a few minor spacing issues.

shabana.navas’s picture

Status: Needs review » Reviewed & tested by the community
joachim’s picture

Status: Reviewed & tested by the community » Fixed

Brilliant, thanks!

git commit -m "Issue #2212727 by Shabana Blackborder: Added detail on behaviour of flag counts during flagging operations to Rules UI descriptions." --author="ShabanaBlackborder "

joachim’s picture

I think we can maybe make a new release now? 3.3 wasn't that long ago, but we have a lot of fixes since then. We just need to brace ourselves for the inevitable tide of Rules users who say their Rules have changed... I'll make sure the release notes mention this prominently, and there's a change record too, but I'm sure lots of people won't read either of those...

shabana.navas’s picture

Yeah, I think these are some major fixes and a new release looks like a really good idea at this point. I am almost certain we're going to have lot more new issues coming in related to these changes. But you can't really blame people, because, I never used to read the change records or release notes myself! And I am pretty sure 90% of users behave pretty much the same way. So we're just going to have to release, and then wait and watch.

Status: Fixed » Closed (fixed)

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