Commit 536a793a authored by Josef Glatz's avatar Josef Glatz Committed by Benni Mack
Browse files

[BUGFIX] Disable extension scanner if no extensions are available

The link to the extension file scanner is removed to avoid any
exception when running a scan if no extension is available at all.

Visually, it's grayed out like the disabled "Update TYPO3 Core"
card in composer mode and the link is removed.

Releases: master, 9.5
Resolves: #90981
Change-Id: I53d41111b51ed74d142894c56a4378fc9d958e8d
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/64100


Tested-by: Oliver Bartsch's avatarOliver Bartsch <bo@cedev.de>
Tested-by: default avatarTYPO3com <noreply@typo3.com>
Tested-by: Georg Ringer's avatarGeorg Ringer <georg.ringer@gmail.com>
Tested-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
Reviewed-by: Oliver Bartsch's avatarOliver Bartsch <bo@cedev.de>
Reviewed-by: Georg Ringer's avatarGeorg Ringer <georg.ringer@gmail.com>
Reviewed-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
parent 0747f03c
......@@ -202,6 +202,7 @@ class UpgradeController extends AbstractController
public function cardsAction(ServerRequestInterface $request): ResponseInterface
{
$view = $this->initializeStandaloneView($request, 'Upgrade/Cards.html');
$view->assign('extensionFoldersInTypo3conf', (new Finder())->directories()->in(Environment::getExtensionsPath())->depth(0)->count());
return new JsonResponse([
'success' => true,
'html' => $view->render(),
......
......@@ -68,14 +68,23 @@
<a href="#" class="btn btn-default" data-require="TYPO3/CMS/Install/Module/Upgrade/TcaMigrationsCheck">Check TCA Migrations</a>
</div>
</div>
<div class="card card-size-fixed-small">
<div class="card card-size-fixed-small {f:if(condition:'!{extensionFoldersInTypo3conf}', then: 'card-disabled')}">
<f:render partial="Card/Header" arguments="{ title: 'Scan Extension Files', subtitle: 'Extensions', icon: 'Icons/modules/install-scan-extensions.svg'}" />
<div class="card-content">
<p class="card-text">Scan extensions for usage of deprecated or outdated TYPO3 API calls.</p>
</div>
<div class="card-footer">
<a href="#" class="btn btn-default" data-require="TYPO3/CMS/Install/Module/Upgrade/ExtensionScanner">Scan Extension Files</a>
</div>
<f:if condition="{extensionFoldersInTypo3conf}">
<f:then>
<div class="card-footer">
<a href="#" class="btn btn-default" data-require="TYPO3/CMS/Install/Module/Upgrade/ExtensionScanner">Scan Extension Files</a>
</div>
</f:then>
<f:else>
<div class="card-footer text-muted">
You can't use this feature, because no extension folders were found.
</div>
</f:else>
</f:if>
</div>
</div>
......
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