diff --git a/typo3/sysext/install/Classes/Controller/UpgradeController.php b/typo3/sysext/install/Classes/Controller/UpgradeController.php index f38d33642342a64c82b344d7a290ce6bc0079773..7e5b2e8d977172325b68b82823f2b3b20a923a8d 100644 --- a/typo3/sysext/install/Classes/Controller/UpgradeController.php +++ b/typo3/sysext/install/Classes/Controller/UpgradeController.php @@ -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(), diff --git a/typo3/sysext/install/Resources/Private/Templates/Upgrade/Cards.html b/typo3/sysext/install/Resources/Private/Templates/Upgrade/Cards.html index 46d6496e74d88a3daccfec3280086d01c108f079..de21fe6a11345df07bdea2558a1ade4b4db1de0d 100644 --- a/typo3/sysext/install/Resources/Private/Templates/Upgrade/Cards.html +++ b/typo3/sysext/install/Resources/Private/Templates/Upgrade/Cards.html @@ -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>