Commit 9477f2e3 authored by Daniel Siepmann's avatar Daniel Siepmann Committed by Susanne Moog
Browse files

[BUGFIX] Make EXT:backend independent of EXT:install

EXT:backend generates a URL to EXT:install, but has no dependency. This
can lead to composer setups with EXT:backend but without EXT:install,
leading to an exception while generating route.

Therefore a suggest is added as a hint to install also EXT:install.
Existing code is wrapped with an try / catch in order to work under both
circumstances.

Resolves: #89419
Releases: master, 9.5
Change-Id: Idedd299f218ae8f7ba9938800d2ac4a0c4e5614b
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/61999


Tested-by: default avatarTYPO3com <noreply@typo3.com>
Tested-by: Andreas Fernandez's avatarAndreas Fernandez <a.fernandez@scripting-base.de>
Tested-by: Georg Ringer's avatarGeorg Ringer <georg.ringer@gmail.com>
Tested-by: Susanne Moog's avatarSusanne Moog <look@susi.dev>
Reviewed-by: default avatarKaravas Aristeidis <aristeidis.karavas@gmail.com>
Reviewed-by: Andreas Fernandez's avatarAndreas Fernandez <a.fernandez@scripting-base.de>
Reviewed-by: Georg Ringer's avatarGeorg Ringer <georg.ringer@gmail.com>
Reviewed-by: Susanne Moog's avatarSusanne Moog <look@susi.dev>
parent c6f589f3
...@@ -22,6 +22,7 @@ use TYPO3\CMS\Core\Core\SystemEnvironmentBuilder; ...@@ -22,6 +22,7 @@ use TYPO3\CMS\Core\Core\SystemEnvironmentBuilder;
use TYPO3\CMS\Core\Database\ConnectionPool; use TYPO3\CMS\Core\Database\ConnectionPool;
use TYPO3\CMS\Core\Localization\LanguageService; use TYPO3\CMS\Core\Localization\LanguageService;
use TYPO3\CMS\Core\Page\PageRenderer; use TYPO3\CMS\Core\Page\PageRenderer;
use TYPO3\CMS\Core\Routing\RouteNotFoundException;
use TYPO3\CMS\Core\Utility\CommandUtility; use TYPO3\CMS\Core\Utility\CommandUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Core\Utility\StringUtility; use TYPO3\CMS\Core\Utility\StringUtility;
...@@ -169,8 +170,15 @@ class SystemInformationToolbarItem implements ToolbarItemInterface ...@@ -169,8 +170,15 @@ class SystemInformationToolbarItem implements ToolbarItemInterface
$uriBuilder = GeneralUtility::makeInstance(UriBuilder::class); $uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
$view = $this->getFluidTemplateObject('SystemInformationDropDown.html'); $view = $this->getFluidTemplateObject('SystemInformationDropDown.html');
try {
$environmentToolUrl = (string)$uriBuilder->buildUriFromRoute('tools_toolsenvironment');
} catch (RouteNotFoundException $e) {
$environmentToolUrl = '';
}
$view->assignMultiple([ $view->assignMultiple([
'environmentToolUrl' => (string)$uriBuilder->buildUriFromRoute('tools_toolsenvironment'), 'environmentToolUrl' => $environmentToolUrl,
'messages' => $this->systemMessages, 'messages' => $this->systemMessages,
'count' => $this->totalCount > $this->maximumCountInBadge ? $this->maximumCountInBadge . '+' : $this->totalCount, 'count' => $this->totalCount > $this->maximumCountInBadge ? $this->maximumCountInBadge . '+' : $this->totalCount,
'severityBadgeClass' => $this->severityBadgeClass, 'severityBadgeClass' => $this->severityBadgeClass,
......
...@@ -5,11 +5,13 @@ ...@@ -5,11 +5,13 @@
<h3 class="dropdown-headline"> <h3 class="dropdown-headline">
<f:translate key="systemmessage.header"/> <f:translate key="systemmessage.header"/>
</h3> </h3>
<p class="dropdown-text typo3-module-menu-item submodule mod-tools_toolsenvironment" data-modulename="tools_toolsenvironment"> <f:if condition="{environmentToolUrl}">
<f:format.raw> <p class="dropdown-text typo3-module-menu-item submodule mod-tools_toolsenvironment" data-modulename="tools_toolsenvironment">
<f:translate key="systemmessage.intro" arguments="{0: '{environmentToolUrl}'}"/> <f:format.raw>
</f:format.raw> <f:translate key="systemmessage.intro" arguments="{0: environmentToolUrl}"/>
</p> </f:format.raw>
</p>
</f:if>
<f:if condition="{systemInformation}"> <f:if condition="{systemInformation}">
<hr> <hr>
......
...@@ -17,6 +17,9 @@ ...@@ -17,6 +17,9 @@
"typo3/cms-core": "10.2.*@dev", "typo3/cms-core": "10.2.*@dev",
"typo3/cms-recordlist": "10.2.*@dev" "typo3/cms-recordlist": "10.2.*@dev"
}, },
"suggest": {
"typo3/cms-install": "To generate url to install tool in environment toolbar"
},
"conflict": { "conflict": {
"typo3/cms": "*" "typo3/cms": "*"
}, },
......
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