Closed (fixed)
Project:
Message Banner
Version:
8.x-1.1
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
20 May 2020 at 19:35 UTC
Updated:
10 Jun 2020 at 08:04 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
wildfeed commentedComment #3
sophie.skHi, thanks for the report!
There is a new permission to display the banner to certain roles. Take a look at #3082328: Allow restriction of messages to certain roles, users, entities. Make sure that anonymous users have this permission assigned.
One thing I overlooked in that issue, though, was that the permission won't be assigned to users by default when the module is installed. I'll add a
hook_install()to make sure that anonymous and authenticated users get the permission on module install.Comment #4
sophie.skOh wait, there IS an install hook. I need more coffee before I start replying to issues. :D
Hmm, can you confirm what your setup is? Did you run the update after upgrading to 1.1 or is this a fresh install?
Comment #5
jmcerda commentedI fixed the issue with the following patch.
Instead of using jQuery .once() i used .one()
Seems to have fixed the issue.
Comment #6
sophie.skHmm, that shouldn't make any difference, but I'm glad it fixed it for you.
I suspect it could be the cache tags. The page attachments only cache based on the config. If it should show/not show based on user role as well, then that should probably be added - it may explain why you're not seeing it appear after assigning a permission, or after a JavaScript change (maybe flushing the caches after that).
Comment #7
sophie.skI've added cache contexts to the message banner and also made sure the jQuery.once library is a dependency for the Message Banner library. Doh! Forgot that needs to be there, administrators obviously can see it.
Comment #9
sophie.skFixed and pushed to dev.