Empty Notification content shown to anonymous users

Created on 23 June 2023, about 1 year ago

Problem/Motivation

Just installed the module and setup per Readme file. Everything seems to be working fine except when the notification bar appears on frontend, it is always missing the content. I can confirm notification bar appears. The "Close Notification" link is displayed and the markup is outputted like:

<section
  id="block-dmbnotificationsblock"
  class="block block-dismissible-message-bar block-dmb-notifications-block block-dmbnotificationsblock clearfix"
>
  <div class="form-group">
    <div class="dmb-notifications-ajax-wrapper">
      <div
        class="dmb-notification form-group"
        dmb-notification-id="1"
        dmb-cookie-expiration="365"
        dmb-auto-dismiss="0"
        dmb-dismiss-time="15"
      >
        <div class="dmb-notification-content form-group"></div>
        <a href="" class="close-dmb-notification">Close notification</a>
      </div>
    </div>
  </div>
</section>

Currently Im just adding content to a wysiwyg field in a paragraph in the content field of the notification.

Ive also attached some screenshots to help illustrate.

I can also confirm, our paragraph works as expected when using in other content types.

Steps to reproduce

Just installed module, configure per readme, and create 1st notification using default bundle.

Question

Do we need to do anything additional to templates or paragraphs for this to work, or do you have any direction on what I might be missing?

Thanks!

πŸ› Bug report
Status

Active

Version

1.6

Component

Documentation

Created by

πŸ‡ΊπŸ‡ΈUnited States justclint

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @justclint
  • πŸ‡ΊπŸ‡ΈUnited States Mojiferous

    Are there any errors in any logs or console? It looks like it is displaying the notification entity, or at least that it is adding something in there, so I would check the default display of the Notification to make sure you are displaying the paragraphs.

  • πŸ‡ΊπŸ‡ΈUnited States justclint

    Thanks @Mojiferous, I finally found issue being permissions. After allowing "anonymous" users to "View published DMB Notifications entities" I can see the notification content now.

    So per my original question, I think we can close this as its solved.

    However, not sure what I just experienced is a bug in the sense that, when a role (anonymous in my case) is not given the permission "View published DMB Notifications entities", they can still view the notification, it just happens to be hiding the content within. Im guessing if role does not have that permission, then expectation would be they should not see the notification at all.

  • Assigned to Mojiferous
  • πŸ‡ΊπŸ‡ΈUnited States Mojiferous

    That's an excellent point, I'm making this a bug right now. Thank you!

Production build 0.69.0 2024