Closed (fixed)
Project:
Related links
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
12 May 2011 at 17:04 UTC
Updated:
4 Jan 2014 at 00:53 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
mcurry commentedAddendum: I've also noticed that the discovered links block is often empty (missing) for logged-in and anonymous users, but it appears as expected for the site admin. Once again, disabling caching fixes this.
The discovered links block is configured to be shown to all users (no roles checked, and all users must view the block, in the block settings page)
Comment #2
mcurry commentedDigging into the module source code, I see that the node's discovered links are updated in hook_block... which means that the block caching mechanism might interfere with discovered links updates.
According to the hook_block API docs, it appears the hook_block 'list' needs to return a 'cache' entry in order to override default caching:
This seems to fix it for me:
Or have I missed something here? Please advise.
Comment #3
mcurry commentedChanging issue title...
Comment #4
mcurry commentedAttaching patch for consideration.
Comment #5
mcurry commentedFixing version, since I'm working against the 6.x-1.0-beta2 branch (that's the last one I installed).
Comment #6
mcurry commentedUpdate: We may need to use BLOCK_NO_CACHE in order to ensure that hook_block() view ops are called on every node load:
Feedback welcome and wanted!
Comment #7
mcurry commentedUgh. It appears that D6 fails to pick up block caching mode changes once a block has been registered in the {blocks} table ( #235673: Changes to block caching mode not caught ), which is the case here - changing the
['cache'] = BLOCK_NO_CACHE(orBLOCK_CACHE_PER_PAGE) will have no effect if you've installed and used the module and relatedlinks blocks previously, and uninstalling the module through Drupal's uninstall feature does not remove existing relatedlinks blocks from the {blocks} table!Note that the 'cache' column is set to 1, which is defined in blocks.module as
BLOCK_CACHE_PER_ROLE. We need to manually update the {blocks} table to use -1 (defined in blocks.module asBLOCK_NO_CACHE) or 4 (BLOCK_CACHE_PER_PAGE).*Sigh...*
Comment #8
mcurry commentedRelated issue -- here's why uninstalling the module doesn't clean out the {block} table's entries for the module:
#735900: Deleting module's blocks when module is uninstalled
Comment #9
mattwmc commentedHmm...is this why my links appear "stuck?"
I have Boost enabled and the related links are always showing the same links even after the cache is cleared.
Comment #10
Zen commentedCommitted with BLOCK_NO_CACHE and an update function. Thanks for the patch.
-K