? Pending

User tests: Successful: Unsuccessful:

avatar joomdonation
joomdonation
22 May 2021

Pull Request for Issue # .

Summary of Changes

In Joomla 4, the right way to create a model object is use MVCFactory after bootComponent. For example https://github.com/joomla/joomla-cms/blob/4.0-dev/administrator/components/com_categories/src/Helper/CategoriesHelper.php#L99

However, there are still some places in our code use old method (create model class directly using new ModelClassName syntax). This PR improves code to make it consistent in our whole codebase.

Testing Instructions

The modified code is random in our CMS, so I think the best way is someone with code review skill to review the code and make sure it is all correct. Or maybe @wilsonge will need to review and merge base on code review.

avatar joomdonation joomdonation - open - 22 May 2021
avatar joomdonation joomdonation - change - 22 May 2021
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 22 May 2021
Category Administration com_admin Modules Front End com_contact Plugins
avatar richard67
richard67 - comment - 22 May 2021
ca7979d 22 May 2021 avatar joomdonation CS
avatar joomdonation joomdonation - change - 22 May 2021
Labels Added: ?
avatar wilsonge
wilsonge - comment - 22 May 2021

I’m happy with most places on review.

Only thing I wouldn’t mind tested is the script.php part doing a J3 to j4 upgrade - just because I don’t know exactly where that runs in the upgrade cycle and whether we’ll be exclusively using the j4 files everywhere (I think it will be fine - but better safe than sorry)

avatar joomdonation
joomdonation - comment - 23 May 2021

@wilsonge I installed Joomla 3.10.0 nightly, tested the update process and it is working well, so I think it is fine.

For technical information, the code which is changed here will be executed when finaliseUpgrade method of UpdateModel is called. It is called when:

If it is needed, I will remove the code which I changed in com_admin/script.php to be safe. Let me know if you want me to do that.

avatar wilsonge wilsonge - change - 30 May 2021
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2021-05-30 01:31:25
Closed_By wilsonge
avatar wilsonge wilsonge - close - 30 May 2021
avatar wilsonge wilsonge - merge - 30 May 2021
avatar wilsonge
wilsonge - comment - 30 May 2021

I’m happy with that explanation. Thanks!

Add a Comment

Login with GitHub to post a comment