? Release Blocker ? Pending

User tests: Successful: Unsuccessful:

avatar joomdonation
joomdonation
23 Nov 2021

Pull Request for Issue #36089.

Summary of Changes

This PR makes small modification to update Joomla! process so that namespace map is re-generated during Joomla! update. It is needed because when we update to new Joomla version which has new extension added, we need to register namespace of that new extension so that it can work properly.

Testing Instructions

  1. Apply patch from this PR
  2. Download the this update package Joomla_4.1.0-dev+pr.35143-Development-Update_Package.zip. I had to modify original update package for this PR #35143 (which introduces new extension for Joomla 4.1) to include the change from this PR so that update process runs smooth.
  3. Go to System -> Update -> Joomla, upload and update your Joomla 4 installation with the above downloaded package. Make sure you do not see any error with the update process.

Actual result BEFORE applying this Pull Request

Without the change from this PR, updating your site to the update package of this PR #35143 will cause a fatal error:

0 Class 'Joomla\Component\Scheduler\Administrator\Extension\SchedulerComponent' not found

Expected result AFTER applying this Pull Request

Update success. Namespace for new extension is successfully registered in administrator/cache/autoload_psr4.php.

Documentation Changes Required

No.

avatar joomdonation joomdonation - open - 23 Nov 2021
avatar joomdonation joomdonation - change - 23 Nov 2021
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 23 Nov 2021
Category Administration com_joomlaupdate
1592fc7 23 Nov 2021 avatar joomdonation CS
avatar joomdonation joomdonation - change - 23 Nov 2021
Labels Added: ?
avatar richard67
richard67 - comment - 23 Nov 2021

Added the release blocker label as inherited from the issue.

avatar bembelimen
bembelimen - comment - 23 Nov 2021

Is a Updater update needed? so if someone updates from 4.0.4 to 4.1 it will still crash?

avatar laoneo
laoneo - comment - 23 Nov 2021

I would not make a hard reference to the map creator in the model. Instead of listen to the 'onTableAfterStore' event in the plugins/extension/namespacemap/namespacemap.php plugin and recreate the map.

avatar joomdonation
joomdonation - comment - 24 Nov 2021

@bembelimen The modified file is extracted before the request is executed, so the new code will be executed, thus we do not need an update for Updater

@laoneo I don't know how onTableAfterStore helps here. If we want to go with plugin approach, I think we can trigger a new event onJoomlaAfterUpdate (we triggered onJoomlaBeforeUpdate earlier) and add new method to plugins/extension/namespacemap/namespacemap.php to re-create the map.

avatar laoneo
laoneo - comment - 24 Nov 2021

@joomdonation that sounds even better. As I made a bad experience adding new events to Joomla, I'm a bit hesitant to add a new ones, that's why I didn't suggest that.

avatar bembelimen
bembelimen - comment - 24 Nov 2021

@bembelimen The modified file is extracted before the request is executed, so the new code will be executed, thus we do not need an update for Updater

Yes, but what happens, if there is a plugin, which uses the new namespaces on a very early trigger (like onAfterInitialize), is this covered?

avatar joomdonation
joomdonation - comment - 24 Nov 2021

Yes, but what happens, if there is a plugin, which uses the new namespaces on a very early trigger (like onAfterInitialize), is this covered?

As I understand, that plugin would only run on the next request. In the current request, the new plugin (if added in the update) is not available in database yet, so it is not being executed.

avatar bembelimen bembelimen - test_item - 25 Nov 2021 - Tested successfully
avatar bembelimen
bembelimen - comment - 25 Nov 2021

I have tested this item successfully on 1592fc7

For the test scenario you should not patch the base 4.0 version but only the version you're updating to. (it's then like 4.0.4 => 4.1).

But anyways, changes are working for me.


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

avatar khu5h1 khu5h1 - test_item - 25 Nov 2021 - Tested successfully
avatar khu5h1
khu5h1 - comment - 25 Nov 2021

I have tested this item successfully on 1592fc7


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

avatar richard67 richard67 - change - 25 Nov 2021
Status Pending Ready to Commit
avatar richard67
richard67 - comment - 25 Nov 2021

RTC


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

avatar wilsonge
wilsonge - comment - 25 Nov 2021

I think not having this in a plugin is probably a good idea here - we don't want any weird issues if we ever namespace the plugin in the future.

avatar wilsonge wilsonge - close - 25 Nov 2021
avatar wilsonge wilsonge - merge - 25 Nov 2021
avatar wilsonge wilsonge - change - 25 Nov 2021
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2021-11-25 21:17:53
Closed_By wilsonge
Labels Added: ? Release Blocker
avatar wilsonge
wilsonge - comment - 25 Nov 2021

Thanks!

avatar Crisje
Crisje - comment - 10 Mar 2022

hi im having this issue atm and idk what to do, I tried to download the link above but it says not found
please if anyone could help me


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/36094.
avatar joomdonation
joomdonation - comment - 10 Mar 2022

@Crisje Delete the file administrator/cache/autoload_psr4.php from your Joomla 4 installation should help solving your issue.

avatar hjstrauss
hjstrauss - comment - 2 Apr 2022

Thanx @Crisje for your tip that worked for me. But why is this still in 4.1.2 code? I did an update from 4.0.3 to 4.1.2 and ran into this error. Kind regards, HaSTe.


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

Add a Comment

Login with GitHub to post a comment