From 7836b994545b9169cb6de94c1817f53397966a38 Mon Sep 17 00:00:00 2001 From: Benjamin Mack <benni@typo3.org> Date: Tue, 27 Oct 2015 14:58:43 +0100 Subject: [PATCH] [BUGFIX] Add reload parameter for EM List Utility If the extension manager list utility "getAvailableExtensions()" is called and then a new package is added at the same request, it is not possible to regenerate the list of availableExtensions as this is cached in a run-time member variable inside the list utility. A new method "reloadAvailableExtensions" is added in order to rebuild the list of available extensions. Resolves: #71071 Releases: master Change-Id: Idab208c27f8905e3770fa1845a805cf3f5c3e8ac Reviewed-on: https://review.typo3.org/44318 Reviewed-by: Nicole Cordes <typo3@cordes.co> Tested-by: Nicole Cordes <typo3@cordes.co> Reviewed-by: Morton Jonuschat <m.jonuschat@mojocode.de> Tested-by: Morton Jonuschat <m.jonuschat@mojocode.de> Reviewed-by: Benni Mack <benni@typo3.org> Tested-by: Benni Mack <benni@typo3.org> --- .../extensionmanager/Classes/Utility/ListUtility.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/typo3/sysext/extensionmanager/Classes/Utility/ListUtility.php b/typo3/sysext/extensionmanager/Classes/Utility/ListUtility.php index 59c57898c4be..235435896d3a 100644 --- a/typo3/sysext/extensionmanager/Classes/Utility/ListUtility.php +++ b/typo3/sysext/extensionmanager/Classes/Utility/ListUtility.php @@ -107,7 +107,8 @@ class ListUtility implements \TYPO3\CMS\Core\SingletonInterface */ public function getAvailableExtensions() { - if ($this->availableExtensions === NULL) { + if ($this->availableExtensions === null) { + $this->availableExtensions = []; $this->emitPackagesMayHaveChangedSignal(); foreach ($this->packageManager->getAvailablePackages() as $package) { $installationType = $this->getInstallTypeForPackage($package); @@ -123,6 +124,14 @@ class ListUtility implements \TYPO3\CMS\Core\SingletonInterface return $this->availableExtensions; } + /** + * Reset and reload the available extensions + */ + public function reloadAvailableExtensions() { + $this->availableExtensions = null; + $this->getAvailableExtensions(); + } + /** * @param string $extensionKey * @return \TYPO3\CMS\Core\Package\PackageInterface -- GitLab