Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[4.2] Fix fatal error when update to Joomla 4.2 #37990

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions administrator/components/com_joomlaupdate/finalisation.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,17 @@ function finalizeUpdate(string $siteRoot, string $restorePath): void
{
(new JoomlaInstallerScript)->deleteUnexistingFiles();
}

/**
* Remove autoload_psr4.php so that namespace map is re-generated on the next request. This is needed
* when there are new classes added to extensions on new Joomla! release.
*/
$namespaceMapFile = JPATH_ROOT . '/administrator/cache/autoload_psr4.php';

if (\Joomla\CMS\Filesystem\File::exists($namespaceMapFile))
{
\Joomla\CMS\Filesystem\File::delete($namespaceMapFile);
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -690,9 +690,6 @@ public function finaliseUpgrade()
return false;
}

// Re-create namespace map. It is needed when updating to a Joomla! version has new extension added
(new \JNamespacePsr4Map)->create();

$installer->manifest = $manifest;

$installer->setUpgrade(true);
Expand Down