Commit 2491f759 authored by Andreas Fernandez's avatar Andreas Fernandez Committed by Benjamin Franzke
Browse files

[BUGFIX] Disallow deleting extensions in Composer mode

Deleting an extension in Extension Manager doesn't make much sense in a
Composer-based installation. For this reason, the removal of extensions
is prohibited now.

Resolves: #91456
Releases: master, 9.5
Change-Id: Ia96cf2741fd749d9f50540366351c8b576cac96b
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/64568


Tested-by: default avatarTYPO3com <noreply@typo3.com>
Tested-by: Markus Klein's avatarMarkus Klein <markus.klein@typo3.org>
Tested-by: Benjamin Franzke's avatarBenjamin Franzke <bfr@qbus.de>
Reviewed-by: Simon Gilli's avatarSimon Gilli <typo3@gilbertsoft.org>
Reviewed-by: Mathias Brodala's avatarMathias Brodala <mbrodala@pagemachine.de>
Reviewed-by: Oliver Bartsch's avatarOliver Bartsch <bo@cedev.de>
Reviewed-by: Oliver Klee's avatarOliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: Markus Klein's avatarMarkus Klein <markus.klein@typo3.org>
Reviewed-by: Benjamin Franzke's avatarBenjamin Franzke <bfr@qbus.de>
parent bd04cd12
......@@ -15,6 +15,7 @@
namespace TYPO3\CMS\Extensionmanager\Controller;
use TYPO3\CMS\Core\Core\Environment;
use TYPO3\CMS\Core\Messaging\FlashMessage;
use TYPO3\CMS\Core\Package\Exception;
use TYPO3\CMS\Core\Package\Exception\PackageStatesFileNotWritableException;
......@@ -138,6 +139,13 @@ class ActionController extends AbstractController
protected function removeExtensionAction($extension)
{
try {
if (Environment::isComposerMode()) {
throw new ExtensionManagerException(
'The system is set to composer mode. You are not allowed to remove any extension.',
1590314046
);
}
$this->installUtility->removeExtension($extension);
$this->addFlashMessage(
LocalizationUtility::translate(
......
......@@ -112,7 +112,9 @@
<div class="btn-group">
<em:processAvailableActions extension="{extension}">
<em:updateScript class="btn btn-default" extensionKey="{extension.key}" />
<em:removeExtension class="btn btn-default" extension="{extension}" />
<f:if condition="!{isComposerMode}">
<em:removeExtension class="btn btn-default" extension="{extension}" />
</f:if>
<f:link.action action="downloadExtensionZip" controller="Action" arguments="{extension:extension.key}" title="{f:translate(key:'extensionList.downloadzip')}" class="btn btn-default">
<core:icon identifier="actions-system-extension-download" />
</f:link.action>
......
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