Reviewed & tested by the community
Project:
Views content cache
Version:
7.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
16 Sep 2011 at 23:40 UTC
Updated:
20 Jul 2020 at 23:34 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
hefox commentedStopping in to say: Looks good from a quick look, and thought about doing the same plugin, but realized it wasn't as useful as I'd have liked. My use for clearing on flag is having flag by like an edit event on content: ie I'd want it to clear when the content of certain types is edited or flagged. I did that via using hook_flag in custom, but I wonder if there is a way for views_content to understand that logic via configuration.
Comment #2
hachreak commented+1
Very useful integration!
I tryed this patch in version 2.2 of this module + views 3, but it seems that not work for me... :(
p.s. I add a default NULL value in options_form of class views_content_cache_key_flag. Otherwise, when I open configuration of cache in views, the views module return me this warning:
warning: Missing argument 2 for views_content_cache_key_flag::options_form()Comment #3
steven jones commentedWe should be able to get this to trigger the cache segments for nodes and comments to record this timestamp additionally, just need to work out how.
Comment #4
jaydub commentedTrying again this time as a plugin for Views Content Cache for Drupal 7. Has Flag hooks for both the 7.2.x and the 7.3.x branch of Flag.
Comment #5
joemaine commentedHey Jaydub,
Great work! The plugin works as expected. I hope your work gets added to the module!
Comment #6
rafaqz commentedPatch looks good, but it's no longer working against current dev.
Line 4 in flag.inc needs to be changed to:
But then I also get this error:
Not sure if this is also new or an already existing bug.
Comment #7
MaWebDesigns commentedI am also very interested in this becoming its own module.
I tried the patch on 7.x-3.0-alpha3 and while it had no side effects, I could not get it to work.
Is there suppose to be an option in the cache settings to get this to work? I just have content caching turned on in my view, with the proper node type selected and the cache times set to 6 hour max.
As it stands right now, what ever I flag the first time always gets returned back to me, no matter if I flag other items (with caching turned on).
Am I using the proper version of the mod? Should I be testing against DEV?
Comment #8
garamani commentedThe patch doesn't work for me. I got this error:

Comment #9
jaydub commented@garamani fwiw your error mentions a PHP fatal error for drupal_error_levels() which has nothing to do with this module or patch so possible that your issue is unrelated.
Comment #10
garamani commentedThanks jaydub
I don't know what was the source of error; flushing the caches didn't help but after restarting the server, Ajax error has gone.
But now there's a new one:
Strict warning: Declaration of views_content_cache_key_flag::options_form() should be compatible with that of views_content_cache_key::options_form() in require_once() (line 3 of C:\Users\Garamani\Downloads\Compressed\apolo\sites\all\modules\views_content_cache\plugins\views_content_cache\flag.inc).
The flag.inc Codes:
Comment #11
jaydub commented@garamani try the small change referenced in #6 above and let me know if that gets rid of the warning.
Comment #12
elamanThe code in the patch is working, but patch needs to be updated.
Regarding the issues in #6, I think the separate issue in the module, that causes SQL errors when you write custom plugins. See #1185268: Nodequeue support (plugin) having the same issue.
Comment #13
glynster commentedApplying the patch and updating the inc manually and this solves the problem completely!
Comment #14
joegraduateAttached is a re-rolled version of #4 that includes the changes recommended in #6 as well as some minor coding standards adjustments.
A separate patch for the SQL errors described in #6 and #12 is available here: #2407467: views_content_cache_update_get() builds incorrect query.
Comment #15
trackleft2THis works for me perfectly
Comment #16
trackleft2RTBC in my opinion