Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
When switching between workspace, the block content is not available until clear the cache.
Steps to reproduce
1. On LIVE workspace: Create a custom block and assign to a region visible on home page.
2. Switch to stage and clear cache
3. Switch back to LIVE workspace.
Expected
See block added in step 1 is visible
Actual:
See 'This block is broken or missing. You may be missing content or you might need to enable the original module.'
The block wouldn't appear back until resave or clear cache in LIVE workspace.
Originally reported by @sirko_el
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
Comment | File | Size | Author |
---|---|---|---|
#18 | 2944805-18.patch | 12.94 KB | timmillwood |
|
Comments
Comment #2
timmillwoodHere's a test patch for this:
Comment #4
timmillwoodMoving to Multiversion, because that's where it needs fixing.
Comment #6
timmillwoodHere's a fix
Comment #9
timmillwoodComment #10
vijaycs85Thanks @timmillwood. I applied the patch and it fixes the broken block.
If we have more than one user logged in and do the steps 1 and 2 in "steps to reproduce" in one session, the other users get the issue.
Comment #11
timmillwoodThis should fix the multi user issue by decorating the BlockManager, and overriding the cache key whenever it's used. I tried to override it in the constructor, although this is loaded really early and often isn't rebuilt when switching workspaces.
Comment #13
vijaycs85Looks much cleaner. Few comments:
Not sure how this affect anyway or why 50.
probably, we can inject it in decorator?
Comment #14
timmillwoodLooks like the cache is cleared before the workspace table is created.
Comment #16
timmillwoodFixing #13 and #14.
Comment #18
timmillwoodComment #20
timmillwoodComment #22
timmillwoodComment #24
timmillwoodI should've credited @sirko_el