? ? Pending

User tests: Successful: Unsuccessful:

avatar YatharthVyas
YatharthVyas
26 Apr 2021

Pull Request for Issue #33311
And I think this also improves the PR for #29950

Edit: The caching part implemented in this PR is not the most optimal way to do it. Thanks, @PhilETaylor for helping me understand this. So for now, I'm striking out the caching part and I'm keeping this PR open as it still fixes Issue #33311
Wherever I've mentioned Caching in this PR, it is only valid when Caching has been enabled from the global configuration settings.

Summary of Changes

Before the PR

  • To display the count of messages, the Post Installation Messages Module called the getItems() function from Post Installation Messages Component's Messages Model
  • This returned an array which was contained an array of all messages filtered by eid (extension id, defaults to 212 for Joomla CMS) which meant that this only accounted for a portion of the total messages
  • The count of this filtered array was used to display the messages count

After the PR

  • Now, the Post Installation Messages Module calls the newly added getItemsCount() function that only returns the count (in integer) of all messages from the database not filtered by the default extension id (eid). Hence this count reflects all the array elements and not just the ones corresponding to Joomla CMS (for example)
  • Only this count is passed to the module thus reducing the memory and performance overhead of passing array
  • This count is directly used to display the message count (avoids the need of using count() function on the array)

You might observe that I've only queried 4 columns in this query.

$db->quoteName('language_extension'),
$db->quoteName('language_client_id'),
$db->quoteName('condition_file'),
$db->quoteName('condition_method'),

This is done because the onProcessList() function that filters the language and extra messages uses these 4 fields. Check the link below

* List post-processing. This is used to run the programmatic display

PR

Testing Instructions

Firstly, make sure you have enabled Caching is enabled in Admin Panel -> Global Configuration -> System

image

  1. 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.

  1. Now try hiding a few messages from Joomla CMS and Atum Administrator Panel each and ensure that the count always reflects the correct value which is the sum of all messages inclusive of each extension id.

Actual result BEFORE applying this Pull Request

image

Note: 24 Queries after 2 refreshes (2 refreshes are done to ensure that caching is successful)

Expected result AFTER applying this Pull Request

image

Note: Still 24 queries (caching works) after 2 refreshes and the count displayed (4) is correct as it corresponds to 3 of Joomla CMS + 1 of Atum Administrator Template

You might encounter a bug while deleting and resetting messages here. Please add #33338 to ensure that you can hide and reset messages easily

Cache.PR.mp4

Also fixed dashboard badge: (Found in Admin Panel -> System)

image

Documentation Changes Required

I am not sure but if documentation for the Post Installation messages component exists for Joomla 4 then this new function getItemsCount() should be mentioned under the Messages Model and the rephrased variable (integer) $messagesCount must be mentioned in Post Installation Modules Documentation

avatar YatharthVyas YatharthVyas - open - 26 Apr 2021
avatar YatharthVyas YatharthVyas - change - 26 Apr 2021
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 26 Apr 2021
Category Administration com_postinstall Modules
avatar YatharthVyas YatharthVyas - change - 26 Apr 2021
Labels Added: ?
avatar YatharthVyas YatharthVyas - change - 26 Apr 2021
The description was changed
avatar YatharthVyas YatharthVyas - edited - 26 Apr 2021
avatar YatharthVyas YatharthVyas - change - 26 Apr 2021
The description was changed
avatar YatharthVyas YatharthVyas - edited - 26 Apr 2021
avatar YatharthVyas YatharthVyas - change - 26 Apr 2021
The description was changed
avatar YatharthVyas YatharthVyas - edited - 26 Apr 2021
avatar YatharthVyas YatharthVyas - change - 26 Apr 2021
The description was changed
avatar YatharthVyas YatharthVyas - edited - 26 Apr 2021
avatar maikol-ortigueira maikol-ortigueira - test_item - 30 Apr 2021 - Tested successfully
avatar maikol-ortigueira
maikol-ortigueira - comment - 30 Apr 2021

I have tested this item successfully on 63cfd3c

I have tested the patch and on my local server it worked perfectly. Before applying the patch it showed me 3 messages in total and once applied it shows me 4 Post installation messages. Curiously before applying the patch and applying the 2 refreshes it shows 24 queries and 3 messages and after applying the patch and performing the 2 refreshes it shows 23 queries.
Thank you.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/33344.

avatar sandramay0905 sandramay0905 - test_item - 9 May 2021 - Tested unsuccessfully
avatar sandramay0905
sandramay0905 - comment - 9 May 2021

I have tested this item ? unsuccessfully on 63cfd3c

Count of notifications works but look is messed (maybe because of conflicting files?):

image


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/33344.
avatar sandramay0905
sandramay0905 - comment - 9 May 2021

I have tested this item ? unsuccessfully on 63cfd3c

Reason for unseccessfully test coming soon.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/33344.

avatar PhilETaylor
PhilETaylor - comment - 9 May 2021

This branch has conflicts that must be resolved
Conflicting files
administrator/modules/mod_post_installation_messages/tmpl/default.php

avatar YatharthVyas YatharthVyas - change - 9 May 2021
Labels Added: Conflicting Files
avatar sandramay0905 sandramay0905 - test_item - 9 May 2021 - Tested successfully
avatar sandramay0905
sandramay0905 - comment - 9 May 2021

I have tested this item successfully on 986cf6e


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/33344.

avatar YatharthVyas
YatharthVyas - comment - 9 May 2021

Thank you.
As correctly identified, the culprit here was the conflicting file. It is now rectified and should work properly.

avatar sandramay0905
sandramay0905 - comment - 14 May 2021

@maikol-ortigueira can you please retest?

avatar maikol-ortigueira maikol-ortigueira - test_item - 14 May 2021 - Not tested
avatar maikol-ortigueira
maikol-ortigueira - comment - 14 May 2021

I have not tested this item.

I have tested the patch and it works perfectly. In the previous test I had used the previous version of the Atum template, and maybe that was the reason for not receiving the same defects commented by @sandramay0905.
This test I have done with the new version of the template.
Joomla version: 4.0.0-beta8-dev
PHP version: 7.4.13
Thank you


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/33344.

avatar maikol-ortigueira
maikol-ortigueira - comment - 14 May 2021

I have not tested this item.

I have tested the patch and it works perfectly. In the previous test I had used the previous version of the Atum template, and maybe that was the reason for not receiving the same defects commented by @sandramay0905.
This test I have done with the new version of the template.
Joomla version: 4.0.0-beta8-dev
PHP version: 7.4.13
Thank you


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/33344.

avatar maikol-ortigueira maikol-ortigueira - test_item - 14 May 2021 - Tested successfully
avatar maikol-ortigueira
maikol-ortigueira - comment - 14 May 2021

I have tested this item successfully on 986cf6e

Sorry for having made the same comment three times, I had not marked the test successfully in the previous messages.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/33344.
avatar YatharthVyas
YatharthVyas - comment - 14 May 2021

@sandramay0905 and @maikol-ortigueira I really appreciate all the efforts you took in going through the lengthy testing instructions to ensure everything works correctly. I am grateful for your time spent in re-testing it again after the UI repaint update.

Thank you?

avatar YatharthVyas YatharthVyas - change - 15 May 2021
Labels Removed: Conflicting Files
avatar PhilETaylor
PhilETaylor - comment - 21 May 2021

Conflicting files
administrator/modules/mod_post_installation_messages/tmpl/default.php

avatar chmst
chmst - comment - 21 May 2021

@sandramay0905 @maikol-ortigueira sorry to bother you :) bit would you please repeat your tests? Thank you!


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/33344.

avatar sandramay0905 sandramay0905 - test_item - 22 May 2021 - Tested successfully
avatar sandramay0905
sandramay0905 - comment - 22 May 2021

I have tested this item successfully on 282fe3b


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/33344.

avatar Krshivam25 Krshivam25 - test_item - 2 Jun 2021 - Tested successfully
avatar Krshivam25
Krshivam25 - comment - 2 Jun 2021

I have tested this item successfully on 282fe3b


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/33344.

avatar YatharthVyas
YatharthVyas - comment - 2 Jun 2021

Resolved a conflict. Could you please retest this PR @sandramay0905 and @Krshivam25
Much thanks

avatar Krshivam25 Krshivam25 - test_item - 2 Jun 2021 - Tested successfully
avatar Krshivam25
Krshivam25 - comment - 2 Jun 2021

I have tested this item successfully on dd8feee


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/33344.

avatar sandramay0905 sandramay0905 - test_item - 3 Jun 2021 - Tested successfully
avatar sandramay0905
sandramay0905 - comment - 3 Jun 2021

I have tested this item successfully on dd8feee


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/33344.

avatar richard67 richard67 - change - 3 Jun 2021
Status Pending Ready to Commit
avatar richard67
richard67 - comment - 3 Jun 2021

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/33344.

avatar chmst chmst - change - 5 Jun 2021
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2021-06-05 09:25:52
Closed_By chmst
Labels Added: ?
avatar chmst chmst - close - 5 Jun 2021
avatar chmst chmst - merge - 5 Jun 2021
avatar chmst
chmst - comment - 5 Jun 2021

Thanks!

avatar YatharthVyas
YatharthVyas - comment - 5 Jun 2021

Thanks everyone!

Add a Comment

Login with GitHub to post a comment