Problem/Motivation
After flushing all caches and executing cron Gin Toolbar will dissapear from the Frontend completely.
You will have to enter the admin-Backend for Gin Toolbar to be reachable.
The only way to reactive Gin Toolbar in the Frontend is to completely deinstall and reinstall the module.
The mentioned behaviour did not occur with Gin Toolbar 2.*
Steps to reproduce
Try the above mentioned steps.
| Comment | File | Size | Author |
|---|---|---|---|
| #15 | 3531929-15.patch | 1.39 KB | abramm |
| #5 | 3531929_gin_toolbar_disappear_on_frontend.patch | 463 bytes | opi |
Comments
Comment #2
opiSame here on Drupal 11.5.0 + Gin_Toolbar 3.0.1 ;
It seems that the third ".toolbar-tab" is missing the ".toolbar-tab--toolbar-item-administration" class to be visible
Comment #3
jurgenhaasWhat version of Drupal core is that happening on? 11.5 as mentioned in #2 doesn't exist yet.
Comment #4
opihaha sorry, mismatch between 10.5.0 and 11.2.0 ; I was talking about 11.2.0 in #2.
After some digging, it seems that after a cache flush the function
gin_toolbar_theme_registry_alter()is run and the check introduced in https://git.drupalcode.org/project/gin_toolbar/-/commit/80e4caa863df5a0a... prevent altering the theme registry if a user without access to the toolbar call the website first. (_gin_toolbar_gin_is_active()will return FALSE)Comment #5
opiIn the meantime, (Use at your own risks) this patch remove the
_gin_toolbar_gin_is_active()check fromgin_toolbar_theme_registry_alter().Comment #6
mediengenosse commentedThanks @jurgenhaas for the quick response. The bug appears @ Drupal core 11.2.0 here.
Comment #7
jurgenhaasGreat findings, thanks @mediengenosse and thanks @opi
The fix described in #5 is actually legit because Gin certainly needs to alter the theme registry, regardless of the current context after a cache rebuild. I'll fix that and we publish a new patch release soon.
@opi contributions are much more helpful when provided in issue forks with MRs. Patch files will go away soon anyway. Just a friendly reminder for next time ;-)
Comment #10
jurgenhaasTurns out, we now have changed
gin_toolbar_theme_registry_alterto alter the registry, but I also found 2 more that should similarly always be executed after a cache rebuild but haven't:I've now updated them both as well. Please test this thoroughly and let us know if everything still works.
Comment #11
opiThe .patch was mostly created for quick composer patching ;)
Agreed with you for the 2 more hooks, according to my quick testing. Thanks for your fast reaction on this !
Comment #12
mediengenosse commentedThanks a lot @jurgenhaas and @opi. I tested the commits and now Gin Tollbar works like expected.
Comment #13
jurgenhaasThanks everyone for your contributions here.
Comment #14
jelle_sA hotfix release of this fix would be greatly appreciated if possible <3
Comment #15
abrammHere's a patch made from both commits fixing the issue.
Posting it in case someone needs to apply it via composer (and doesn't want to switch to dev version).
Comment #16
jurgenhaasWill come soon, just coordinating with a couple of other fixes here and in Gin.
@abramm Do you know that this is bad practice and you should never grab patches from d.o with composer? You should always download the patches locally and refer to them there.
Comment #17
abrammI'm not seeing any problem with patches from Drupal.org. It's more a question of preference; in any case, someone could download the patch and commit it locally if they prefer.
(Using patches from d.org MRs is definitely a bad practice, though.)
Comment #18
jurgenhaasThere is no assurance that patch files do always exist on d.o - and the DA has always insisted in people not requesting patches from there. Soon, when the migration to GitLab will be completed, all the patch files will most likely be gone. That's why everybody is asked to keep their required patch files locally in the project that requires them.
Comment #19
abrammWell, in that case, I just hope it will live long enough until the release 😅.
That's a fair point, though.