?
avatar PhilETaylor
PhilETaylor
25 Apr 2021

Steps to reproduce the issue

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.

Expected result

Expect the Bell to show a badge showing the number of messages to read

Screenshot 2021-04-25 at 17 35 53

Actual result

Screenshot 2021-04-25 at 17 36 15

System information (as much as possible)

Additional comments

You can see the message is unread/waiting if you go back to the Post Installation Messages page and change to Atum Administrator Template

Screenshot 2021-04-25 at 17 37 13

avatar PhilETaylor PhilETaylor - open - 25 Apr 2021
avatar joomla-cms-bot joomla-cms-bot - change - 25 Apr 2021
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 25 Apr 2021
avatar YatharthVyas
YatharthVyas - comment - 25 Apr 2021

Issue Confirmed.

My findings while debugging this:

This is happening because the Module that renders the Post Installation Messages Button uses getIems() function

from com_postinstall/src/Model/MessagesModel.php to determine the count


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)
$query->where($db->quoteName('extension_id') . ' = :eid')

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

Image 2

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

However, deleting these 2 lines is not the correct way to go as getItems() is also used to render the messages for the
Post 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!

avatar PhilETaylor
PhilETaylor - comment - 25 Apr 2021

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.

avatar alikon alikon - change - 26 Apr 2021
Status New Closed
Closed_Date 0000-00-00 00:00:00 2021-04-26 17:22:00
Closed_By alikon
avatar alikon alikon - close - 26 Apr 2021
avatar alikon
alikon - comment - 26 Apr 2021

please test #33344

Add a Comment

Login with GitHub to post a comment