RTC PR-5.3-dev Pending

User tests: Successful: Unsuccessful:

avatar joomdonation
joomdonation
5 Mar 2025

Pull Request for Issue # .

Summary of Changes

This PR makes several clean up to com_templates StyleModel:

  • Remove populateState method, it does not do anything different than the code in parent class, so the override is useless
  • Improve getItem method. Instead of copying code from parent class, we just call the method from parent class to get item data, then add additional logic to it.
  • Improve preprocessForm code, prevent potential warnings when saving item failure (in that case, $data is an array, so we could not treat it as an object like how we do in the code at the moment)

Testing Instructions

  1. Use Joomla 5.3
  2. Apply patch
  3. Access to System -> Template Styles, edit a template style and make sure it is still working as expected

Actual result BEFORE applying this Pull Request

Works, but there is potential warning when saving item false (not easy to show it to you)

Expected result AFTER applying this Pull Request

Works, with less, cleaner code and no potential warnings.

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:

  • No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

avatar joomdonation joomdonation - open - 5 Mar 2025
avatar joomdonation joomdonation - change - 5 Mar 2025
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 5 Mar 2025
Category Administration com_templates
avatar joomdonation joomdonation - change - 7 Mar 2025
Labels Added: PR-5.3-dev
avatar alikon alikon - test_item - 7 Mar 2025 - Tested successfully
avatar alikon
alikon - comment - 7 Mar 2025

I have tested this item ✅ successfully on 24d923d


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

avatar joomdonation
joomdonation - comment - 7 Mar 2025

Thanks @alikon

avatar richard67 richard67 - alter_testresult - 7 Mar 2025 - alikon: Tested successfully
avatar muhme
muhme - comment - 7 Mar 2025

I have tested on fc4338fbe3 with only the System Tests. Before applying this PR there are PHP Warnings:

  • api/com_templates/Site.cy.js
PHP Warning:  Attempt to read property "parent" on array in /var/www/html/administrator/components/com_templates/src/Model/StyleModel.php on line 399
PHP Warning:  Attempt to read property "parent" on array in /var/www/html/administrator/components/com_templates/src/Model/StyleModel.php on line 400
PHP Warning:  Attempt to read property "parent" on array in /var/www/html/administrator/components/com_templates/src/Model/StyleModel.php on line 399
PHP Warning:  Attempt to read property "parent" on array in /var/www/html/administrator/components/com_templates/src/Model/StyleModel.php on line 400
  • and api/com_templates/Administrator.cy.js
PHP Warning:  Attempt to read property "parent" on array in /var/www/html/administrator/components/com_templates/src/Model/StyleModel.php on line 399
PHP Warning:  Attempt to read property "parent" on array in /var/www/html/administrator/components/com_templates/src/Model/StyleModel.php on line 400

✅ After applying this PR the two tests are passing successfully and without PHP warnings.

avatar joomdonation
joomdonation - comment - 8 Mar 2025

Thanks @muhme. This PR also modifies code in different methods inside the StyleModel class, beside System tests, we also need to do real test to make sure template style can still be updated without error.

avatar fgsw
fgsw - comment - 8 Mar 2025

@joomdonation Is it enough to modify a template style and save? Or mean the instructions another way saying "potential warning when saving item false (not easy to show it) (…) Works (…) no potential warnings".

avatar joomdonation
joomdonation - comment - 8 Mar 2025

Thanks @fgsw. Just edit template style, save it and make sure that it is still working like before (mean nothing is broken with updating a template style)

avatar fgsw fgsw - test_item - 8 Mar 2025 - Tested successfully
avatar fgsw
fgsw - comment - 8 Mar 2025

I have tested this item ✅ successfully on 043c7ad

Changed all colour fields settings, added an image to each image field.

avatar joomdonation joomdonation - change - 9 Mar 2025
Status Pending Ready to Commit
avatar joomdonation
joomdonation - comment - 9 Mar 2025

RTC. Thanks for testing!


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

avatar QuyTon QuyTon - change - 9 Mar 2025
Labels Added: RTC
avatar laoneo laoneo - close - 9 Mar 2025
avatar laoneo laoneo - merge - 9 Mar 2025
avatar laoneo laoneo - change - 9 Mar 2025
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2025-03-09 07:58:56
Closed_By laoneo
avatar laoneo
laoneo - comment - 9 Mar 2025

Thanks!

avatar joomdonation
joomdonation - comment - 9 Mar 2025

Thanks everyone !

Add a Comment

Login with GitHub to post a comment