[BUGFIX] Required extensions are not installable
authorGeorg Ringer <georg.ringer@gmail.com>
Thu, 13 Sep 2012 05:39:47 +0000 (07:39 +0200)
committerSteffen Gebert <steffen.gebert@typo3.org>
Sat, 22 Sep 2012 21:29:19 +0000 (23:29 +0200)
Required extensions can't be installed or deinstalled,
therefore the link is not needed. Additionally system
extensions should not be removable.

Change-Id: Id99abd8a4b434d1a769fa20bd987619b0248f636
Fixes: #40882
Releases: 6.0
Reviewed-on: http://review.typo3.org/14567
Reviewed-by: Susanne Moog
Tested-by: Susanne Moog
typo3/sysext/extensionmanager/Classes/ViewHelpers/RemoveExtensionViewHelper.php
typo3/sysext/extensionmanager/Classes/ViewHelpers/ToggleExtensionInstallationStateViewHelper.php

index ddc7dcd..a1bcb6f 100644 (file)
@@ -47,7 +47,10 @@ class RemoveExtensionViewHelper extends \TYPO3\CMS\Fluid\ViewHelpers\Link\Action
         * @return string the rendered a tag
         */
        public function render($extension) {
-               if (!in_array($extension['type'], \TYPO3\CMS\Extensionmanager\Domain\Model\Extension::returnAllowedInstallTypes())) {
+               if (
+                       !in_array($extension['type'], \TYPO3\CMS\Extensionmanager\Domain\Model\Extension::returnAllowedInstallTypes()) ||
+                       $extension['type'] === 'System'
+               ) {
                        return '';
                }
                $uriBuilder = $this->controllerContext->getUriBuilder();
index 950e9f3..ec1f919 100644 (file)
@@ -47,6 +47,13 @@ class ToggleExtensionInstallationStateViewHelper extends \TYPO3\CMS\Fluid\ViewHe
         * @return string the rendered a tag
         */
        public function render($extension) {
+               $requiredExtensions = \TYPO3\CMS\Core\Extension\ExtensionManager::getRequiredExtensionListArray();
+
+                       // Required extensions can't be activated or deactivated
+               if (in_array($extension['key'], $requiredExtensions)) {
+                       return '';
+               }
+
                $uriBuilder = $this->controllerContext->getUriBuilder();
                $action = 'toggleExtensionInstallationState';
                $uri = $uriBuilder->reset()->uriFor($action, array(