Closed (outdated)
Project:
Flag
Version:
7.x-3.x-dev
Component:
Flag core
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
30 May 2010 at 16:27 UTC
Updated:
18 Aug 2025 at 14:41 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
dawehnerHere is the patch
Comment #2
andrewlevine commentedMy plan is to test the 2 patches on the train home in the next couple hours.
This code looks good, the one comment I have is to call the variable something like delete_expired_flag_data instead of something with "cleanup". Because in my opinion it's not that the table will not be clean, but it will have normalized data :). You guys might have a better name than I can come up with.
Comment #3
andrewlevine commentedI have made three small changes to this patch:
1. I changed the option name from session_api_cleanup to delete_expired_flag_content
2. I added a check for an empty $fids array so query errors won't occur when all flags are set to keep expired session flag_content
3. I added some comments explaining the option
I tested the original patch with 2 flags types with anonymous and user data (with the increment patch). One flag type was set to delete expired flag_content, the other not. Only the one set was deleted and only the anonymous data was deleted as expected. The counts were unaffected as expected.
I don't believe my changes should affect the correctness of the original patch but someone may want to check :)
Comment #4
andrewlevine commentedAnd here are my modifications
Comment #5
jaydub commentedPatch no longer applies cleanly with git apply, applies with some offset/fuzz with 'patch -p0'. Setting to needs work to get a clean git patch and since this is more than a year old, possibly to see if the code still applies.
Comment #6
quicksketchHere are patches for D6 and D7 branches. If any enterprising soul that needs this functionality can give it a review that would be great. In the mean time I don't see value in hurriedly adding this functionality, as it's rather obscure.
Note that I converted the D6 version to properly use db_placeholders() instead of just implode(',', $args).
The patch at #719616: Keep flag_counts current by manual in/decreasing of count. finally made it in too, so prerequisites for this patch are finally met.
Comment #7
glitz commentedi will attempt this patch soon and post back.
im searching for a way to avoid a user "un-flagging" content. Instead, un-flagging would become automatic, say, after 5 hours of the user initial flagging.
------------------------
Ex: Flag for a "Check In"
A user visits a node (place) and flags "Check-in". The system would then automatically check the user out after 5 hours, therefore resets the flag for them for the next time they "Check in" at that same particualar place.
Hoping this patch points me in the right direction.
Thanks!
Chris
Comment #8
BigMike commented@#7 Chris, were you ever able to figure something like this out?
Also, if I just wanted to reset all of my user's flagged content, would I just simply empty the flag_content table?
Thanks
Mike
Comment #9
BigMike commented"if I just wanted to reset all of my user's flagged content, would I just simply empty the flag_content table?"
I just figured out this works.
Thanks,
Mike
Comment #10
quicksketchMake sure you also clear out the flag_counts table. You might get yourself into trouble if you have any other modules that make database entries on flag/unflag, but for basic installs emptying out the flag_content and flag_counts tables should work fine.
Comment #11
BigMike commentedThank you very much for this extra bit of info good Sir!
Got it done just now! Thanks! -Mike
Comment #12
glitz commentedCurious to Know how this was done. also If there is a way to set a time limit per flag. Similar to: http://drupal.org/node/1352026
Comment #13
joachim commentedUpping the version, changing the status.
Comment #14
ivnishDrupal 7 is EOL. No more new features will be added. Issue will be closed, but patches are still here