Closed (fixed)
Project:
Private Message
Version:
8.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
19 Mar 2019 at 19:36 UTC
Updated:
12 Feb 2022 at 13:04 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
phjouComment #3
phjouI have investigate this issue and just have found the origin. The refresh update is not working with the big_pipe module of the core.
At the loading of the page, the Javascript try to get the container:
notificationWrapper = $(".private-message-notification-wrapper");But the content of the block is added by an ajax command, so the variable is empty. We only have this in the HTML:
<span data-big-pipe-placeholder-id="callback=Drupal%5Cblock%5CBlockViewBuilder%3A%3AlazyBuilder&args%5B0%5D=culturebrew_privatemessagenotification&args%5B1%5D=full&args%5B2%5D&token=FKPASNQnR7hH0_6yMvkmdqzTfhEIC3Ir-ysvzJTetmQ"></span><div class="block block-private-message block-private-message-actions-block" id="block-culturebrew-privatemessageactions">.
Maybe we should at least disable Big Pipe on the Notification and Inbox blocks in order to fix the refresh.
Comment #4
phjouJust did a patch to disable the lazy loading on the notification and the inbox blocks.
Comment #5
phjouComment #6
phjouOk, just have found that it doesn't work correctly the container variable is undefined in the JS. I don't really know why :(
Comment #7
phjouI am not sure, but it looks like this issue could be the origin of the problem.
https://www.drupal.org/project/drupal/issues/1988968
Comment #10
henzzapp commentedThe element "notificationWrapper" should be assigned after receiving an AJAX response with
unreadThreadCountvalue.Comment #13
artem_sylchukThe issue with the JS of this module is that it doesn't use Drupal.behaviors properly that guarantee that content is present on the page before running scripts.
It seems to be pretty major rewrite of the module's JS to make it use contexts and behaviors properly, so marking this as closed.