Closed (fixed)
Project:
Block Cache Alter
Version:
7.x-1.x-dev
Component:
Code
Priority:
Major
Category:
Feature request
Assigned:
Issue tags:
Reporter:
Created:
5 May 2012 at 10:49 UTC
Updated:
22 Nov 2014 at 11:14 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
timaholt commentedHey guys, i needed a full updated version of blockcache_alter that works with D7. This is a patch that updates the d7 version. It adds a new core patch for 7, and includes some extra features over the 6.x version. Those include:
- More helpful debug mode, that prints out the state of each block that is rendered on the page
- The ability to enable block caching for user 1 (not recommended except for testing!)
The only thing that is lacks from the 6.x version is the Nodequeue support, which should be simple to add back in.
Comment #2
timaholt commentedOne other note on the above patch, it allows you to turn on block caching even when modules use node grants. I figure that there's really no reason to not want this option, and so there is only one patch included. Anyone who knows enough about block caching to use this module should also understand how to set block caching when modules implement node grants. In fact for me that's probably the biggest use case for this module anyway :-)
Comment #3
bharata commentedIs there any chance this patch is in the dev? I'm still a bit iffy about applying patches.
Thanks for taking the time to reply!
Comment #4
timaholt commentedHere's an upload of the module itself for quick testing, but that patch should apply cleanly to the 7.x-1.x branch.
Comment #5
pfrenssen@bharata: If you need help applying patches, take a look at Applying patches. It has step-by-step instructions and links to articles about patching on Windows and Mac OSX at the bottom. It's easy once you know how :)
Comment #6
fabianx commentedLove it!
I'll need to review this at some point ...
Anyone using this in production?
Comment #7
damontgomery commentedHere is a patch against current dev release. We've applied the core patch and this patch and are testing a bit.
ugg... use the next one.
Comment #8
damontgomery commentedOk, I missed a few things in that last one :(.
Comment #9
Kazanir commentedpandaeskimo, I applied your patch to 7.x-1.x and added the included core patch but my debug results show that none of my blocks are caching, despite being set to cache with a large minimum lifetime and testing on both anonymous and non-user-1 authenticated users. Where should I start looking to troubleshoot this?
Comment #10
cuteapoot commentedThe patch in #8 has a type in its hook_user_logout implementation. The function is looking for "&$edit," which isn't part of hook_user_logout (it is part of hook_user_login, so I'm assuming that's where the confusion came from). I've attached the same patch with that variable removed. This will get rid of any errors you get saying "Warning: Parameter 1 to blockcache_alter_user_logout() expected to be a reference, value given in module_invoke_all() (line 857 of .../module.inc).
Comment #11
helmo commentedHere's a re-roll of the patch with a re-roll of the core patch against 7.28 included.
Comment #12
Anonymous (not verified) commentedWe used patch #11 to cache a i18n Taxonomy menu with +/+ 4700 counted nodes, rendered in Superfish. Render time without cache 1200ms, with cache 0ms. Measured with Block Timer https://www.drupal.org/sandbox/jchin1968/2061005 (sandbox).
Hint:
If you don't like patching core (i don't like it): copy the patched block module to sites/all/modules or the costum module directory you use. Drupal wil use this version of Block.
You can safely replace the patched Block module in Drupal core with the original Block module or update Drupal core withouth patching the Block module again. Only major changes or security changes in the Block module could give problems and you have to patch the Block module again.
Comment #13
fabianx commentedThis will need some manual testing, but looks good on first glance.
Comment #14
fabianx commentedThese will only work with corepatch enabled, so also needs #states support.
This should be done with #states API ...
This really should use classes.
This should use #markup => '
'.
Though this should just have a #theme => container in the $form['cache'].
Unfortunately needs some cosmetic work, besides that works fine.
Comment #15
pal4life commentedConfused, what is the end result and if any of these work fine?
Is this the right summary?
#12 - Hacks core :)
Comment #16
jhedstromThis attempts to address the issues in #14. For the styling ones, I simply removed the divs and inline styles to simplify the code.
I'm also directly attaching the patch to this issue for ease of use with drush make. If this patch gets committed, it would be nice to directly link the patch from the project page.
Comment #17
fabianx commented**RTBM** - looks great to me, will leave for some time in that state, then apply to HEAD
Comment #18
ollie222 commented#16 looks to be working for me too.
Comment #19
jhedstromPatch in #16 was causing PHP warnings in PHP 5.5:
PHP Warning: Parameter 1 to blockcache_alter_user_delete() expected to be a reference, value given in /opt/development/integration.vista/drupal/includes/module.inc on line 895This fixes the hook to be properly declared.
Comment #20
jhedstromOops, malformed patch above.
Comment #21
fabianx commentedCNW, per #20. Thanks, jhedstrom!
Comment #22
jhedstromNeeds review I think.
Comment #23
fabianx commentedSince Drupal 7.33 there is now a new option to override the node grants problem:
'block_cache_bypass_node_grants'
I assume we should adjust the patch to that ...
Leaving at CNR for now.
Comment #24
fabianx commentedRTBC, I will adjust the core patch some during commit ...
Comment #25
fabianx commentedCommitted and pushed to 7.x-1.x.
We need to re-port the core patch to the new version now though, I opened #2371599: Port BCA patch to Drupal 7.33 as follow-up.
Thanks all!