Unchecking "Applies to administration pages" in the settings screen updates the breadcrumb correctly. However, rechecking the option does not bring the updated breadcrumb back!
To test:
Load the EB setting screen.
Uncheck "Applies to administration pages"
Save the form.
The title Easy breadcrumb disappears from the screen.
Re check the option and save.
The title does NOT reappear and it should.
Clear cache, the title re-appears.
This threw me off when testing the last issue. I manually checked other EB config options and they work as expected. So, something is funky with caching and this one setting.
| Comment | File | Size | Author |
|---|---|---|---|
| #18 | 3619809 after.png | 388.12 KB | csakiistvan |
| #18 | 3619809 before.png | 77.78 KB | csakiistvan |
Issue fork easy_breadcrumb-3619809
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
greg boggsI tested that the test failed before changing the code. Then, I added the config cache context, and tested passed. I then checked manually in Drupal and confirmed that toggling the admin route setting on and off makes the breadcrumbs change on and off.
Disclosure: AI was used to help me figure out why this is a bug, and to write the Test.
Comment #4
greg boggsComment #5
loopduplicate commentedComment #7
loopduplicate commentedShoot, the error is the same as the one on my local:
Unassigning from myself to hear from Greg on his thoughts for next steps.
Comment #9
loopduplicate commentedI hooked into the configuration save event to invalidate a custom tag that is added in the applies() method when the configuration for applying to admin routes is disabled.
Comment #10
loopduplicate commentedComment #11
loopduplicate commentedOof, this is a real doozy. I'll have to come back to it. Or maybe someone else can figure it out.
Comment #12
loopduplicate commentedComment #15
loopduplicate commentedWhat I've done this time is:
Added a cache context and an event subscriber for config save.
In the applies() method, I add the cache context.
In the context subscriber, using the same logic for checking the "applies to admin paths" config and for checking to see if the current request is an admin path as is in the applies() method, I return a particular tag.
Then, in the config save event subscriber, the tag is invalidated.
Comment #16
loopduplicate commentedFresh brain, new day. Turns out we don't need a subscriber. The context plugin is all that's needed.
Comment #17
csakiistvan✅ Tested and works — MR !231. The fresh-brain call in was right: the context plugin on its own is enough, no config-save subscriber needed, and none of the earlier symptoms come back — no cache-redirect warning, and no missing
cache_context.easy_breadcrumbservice when admin crumbs are disabled.Comment #18
csakiistvanComment #19
greg boggsI tested this manually in tug boat, it works perfectly and I love having our own cache context to use for any future cache issues!
RTBC ++
Comment #20
loopduplicate commentedOMG, yes, Greg. That's how I feel too. Thanks also @csakiistvan. I'll work on merging this in now.
Comment #22
csakiistvanNice to work with you guys <3
Comment #23
loopduplicate commentedyou too, csakiistvan. Community is so important