Currently we have this functionality in the Rules integration. This patch moves it to an API function and let Rules use that function.

CommentFileSizeAuthor
flag-trim-api.patch2.27 KBamitaibu

Comments

ajayg’s picture

From what I gather from patch you are just unflagging flags beyond cutoff point. This is not a real trim in the sense that it won't actually delete the flag record from the database. Am I correct? If this is correct then the flag entries will just continue to grow and may not benefit in the long term for performance and storage. This is not worse than the current but loosing the potential benefits possible. Shouldn't we actuall delete the records?

amitaibu’s picture

> This is not a real trim in the sense that it won't actually delete the flag record from the database. Am I correct?

No. This patch only moves to an API the Rules action to trim a flag (which removes flags - i.e. delete their records).

ajayg’s picture

SOrry for asking stupid question. I get that whatever was part of Rules action is now moved to API. But I still don't get where we actually delete the record? I looked at the patch above and as part of trim you are just unflagging. Does this mean the rules will be deleting the records after call to this API? Would n't be nice this is available as 6.x core action so there is no need for rules module?

ajayg’s picture

Ok I see what you are doing. Just refactoring and moving code from "flag_rules_action_trim" to another seperate function flag_trim_flag.

But what is real value addition of original flag_rules_action_trim as all it is doing is calling flag_trim_flag? Sorry if I am asking too many dumb questions.

amitaibu’s picture

> But what is real value addition of original flag_rules_action_trim as all

See this doc - http://drupal.org/node/407070

ajayg’s picture

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

Title: Make "Trim falg" an API function » Make "Trim flag" an API function
quicksketch’s picture

Status: Reviewed & tested by the community » Fixed

Committed to the 2.x branch (not sure why I can't get this tagged as 2.x yet since the branch exists).

quicksketch’s picture

Version: 6.x-1.x-dev » 6.x-2.x-dev

Status: Fixed » Closed (fixed)

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