Install Joomla 4.0-dev
Go to the Post Installation Messages and click hide all messages.
Note that the Bell in the toolbar top right has no red number on it.
Run this SQL to add a fake post installation message for the Atum Template (change the db prefix!) - this replicates you installing a new extension that inserted a new post install message.
INSERT INTO `jos_postinstall_messages` (`postinstall_message_id`, `extension_id`, `title_key`, `description_key`, `action_key`, `language_extension`, `language_client_id`, `type`, `action_file`, `action`, `condition_file`, `condition_method`, `version_introduced`, `enabled`)
VALUES
(99, 210, 'TEST', 'TEST', '', 'com_cpanel', 1, 'message', '', '', '', '', '4.0.0', 1);
Reload the admin home page.
Expect the Bell to show a badge showing the number of messages to read
You can see the message is unread/waiting if you go back to the Post Installation Messages page and change to Atum Administrator Template
Labels |
Added:
?
|
Although I have flagged this as a Joomla 4 issue - it probably is the same in Joomla 3 also - although "aint nobody got time for that" anymore.
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2021-04-26 17:22:00 |
Closed_By | ⇒ | alikon |
Issue Confirmed.
My findings while debugging this:
This is happening because the Module that renders the Post Installation Messages Button uses
getIems()
functionjoomla-cms/administrator/modules/mod_post_installation_messages/mod_post_installation_messages.php
Line 19 in 4d831f7
from
com_postinstall/src/Model/MessagesModel.php
to determine the countjoomla-cms/administrator/components/com_postinstall/src/Model/MessagesModel.php
Line 130 in 4d831f7
This getItems() function returns only those items that match the extension id (:eid) returned by
$this->getJoomlaFilesExtensionId()
(binded in the query as :eid) which happens to be Joomla CMS (ID: 212)joomla-cms/administrator/components/com_postinstall/src/Model/MessagesModel.php
Line 160 in 4d831f7
If you temporarily remove line 160 and 161 (refer to the above link) then the correct messages count is shown as we are no longer putting a constraint on the extension_id :
Image 1
Correct Output (All Joomla CMS Messages have been hidden)

Image 2
Correct Output for Count but TEST message (from Atum Administrator Template) is also being shown

However, deleting these 2 lines is not the correct way to go as
getItems()
is also used to render the messages for thePost Installation Messages Component page (Refer 2nd image where TEST is getting rendered for Joomla CMS selection).
Hence, I believe that a new function is required in Model.php that returns the count of all messages not limited by a single extension_id and this function's return output should be used to display the messages count.
Hope this helps!