Commit 5adcd1a9 authored by Oliver Bartsch's avatar Oliver Bartsch
Browse files

[TASK] Use ModuleData API in ExtensionManager ListController

The ModuleData API, introduced in #96895,
is now used in the ListController of
EXT:extensionmanager.

Resolves: #96952
Related: #96895
Releases: main
Change-Id: Iad5052aad5c6d7491429eb057693cc361a23aae6
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/73587


Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
Tested-by: Stefan Bürk's avatarStefan Bürk <stefan@buerk.tech>
Tested-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
Tested-by: Oliver Bartsch's avatarOliver Bartsch <bo@cedev.de>
Reviewed-by: Stefan Bürk's avatarStefan Bürk <stefan@buerk.tech>
Reviewed-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
Reviewed-by: Oliver Bartsch's avatarOliver Bartsch <bo@cedev.de>
parent 4c6d1c9a
...@@ -72,11 +72,15 @@ class ListController extends AbstractController ...@@ -72,11 +72,15 @@ class ListController extends AbstractController
*/ */
protected function indexAction(): ResponseInterface protected function indexAction(): ResponseInterface
{ {
if ($this->request->hasArgument('filter') && is_string($this->request->getArgument('filter'))) { $moduleData = $this->request->getAttribute('moduleData');
if ($this->request->hasArgument('filter')
&& is_string($this->request->getArgument('filter'))
) {
$filter = $this->request->getArgument('filter'); $filter = $this->request->getArgument('filter');
$this->saveBackendUserFilter($filter); $moduleData->set('filter', $filter);
$this->getBackendUserAuthentication()->pushModuleData($moduleData->getModuleIdentifier(), $moduleData->toArray());
} else { } else {
$filter = $this->getBackendUserFilter(); $filter = (string)$moduleData->get('filter');
} }
$this->addComposerModeNotification(); $this->addComposerModeNotification();
$isComposerMode = Environment::isComposerMode(); $isComposerMode = Environment::isComposerMode();
...@@ -252,16 +256,6 @@ class ListController extends AbstractController ...@@ -252,16 +256,6 @@ class ListController extends AbstractController
} }
} }
protected function getBackendUserFilter(): string
{
return (string)($this->getBackendUserAuthentication()->getModuleData('ExtensionManager')['filter'] ?? '');
}
protected function saveBackendUserFilter(string $filter): void
{
$this->getBackendUserAuthentication()->pushModuleData('ExtensionManager', ['filter' => $filter]);
}
protected function enrichExtensionsWithViewInformation(array $availableAndInstalledExtensions, bool $isComposerMode): array protected function enrichExtensionsWithViewInformation(array $availableAndInstalledExtensions, bool $isComposerMode): array
{ {
$isOfflineMode = (bool)($this->settings['offlineMode'] ?? false); $isOfflineMode = (bool)($this->settings['offlineMode'] ?? false);
......
...@@ -41,5 +41,8 @@ return [ ...@@ -41,5 +41,8 @@ return [
'list', 'detail', 'list', 'detail',
], ],
], ],
'moduleData' => [
'filter' => '',
],
], ],
]; ];
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment