User tests: Successful: Unsuccessful:
Pull Request for Issue # .
This PR makes several clean up to com_templates StyleModel:
populateState
method, it does not do anything different than the code in parent class, so the override is uselessgetItem
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.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)Works, but there is potential warning when saving item false (not easy to show it to you)
Works, with less, cleaner code and no potential warnings.
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
Status | New | ⇒ | Pending |
Category | ⇒ | Administration com_templates |
Labels |
Added:
PR-5.3-dev
|
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
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.
@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".
I have tested this item ✅ successfully on 043c7ad
Changed all colour fields settings, added an image to each image field.
Status | Pending | ⇒ | Ready to Commit |
RTC. Thanks for testing!
Labels |
Added:
RTC
|
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 |
Thanks!
Thanks everyone !
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.