[5.3] Clean up com_templates StyleModel#45077
Conversation
|
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. |
|
Thanks @alikon |
|
I have tested on
✅ After applying this PR the two tests are passing successfully and without PHP warnings. |
|
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. |
|
@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". |
|
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) |
|
I have tested this item ✅ successfully on 043c7ad
|
|
RTC. Thanks for testing! This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/45077. |
|
Thanks! |
|
Thanks everyone ! |
Pull Request for Issue # .
Summary of Changes
This PR makes several clean up to com_templates StyleModel:
populateStatemethod, it does not do anything different than the code in parent class, so the override is uselessgetItemmethod. 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.preprocessFormcode, 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
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