Skip to content

Commit

Permalink
Fix fatal error when update to Joomla 4.2 (#37990)
Browse files Browse the repository at this point in the history
  • Loading branch information
joomdonation committed Jun 6, 2022
1 parent 0da5be0 commit 4046858
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
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

0 comments on commit 4046858

Please sign in to comment.