From 1553fd4951a0f9fb1203e6ebdcfa1cf4f4e8ddd0 Mon Sep 17 00:00:00 2001 From: Felix Althaus <felix.althaus@undkonsorten.com> Date: Tue, 3 May 2016 23:48:17 +0200 Subject: [PATCH] [BUGFIX] System information: set error filter in link to log MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The link in system information menu "We have found 2 errors. Please check your system log" will now set the appropriate filter in log to only show errors. Before this patch user‘s last filter state was spawned. This could result in errors not even being displayed at all. Resolves: #76009 Releases: master Change-Id: Id90ac9950ff71cd1fb5db1724590cf939fc22823 Reviewed-on: https://review.typo3.org/48005 Tested-by: TYPO3com <no-reply@typo3.com> Reviewed-by: Sebastian Hofer <sebastian.hofer@marit.ag> Tested-by: Sebastian Hofer <sebastian.hofer@marit.ag> Reviewed-by: Nicole Cordes <typo3@cordes.co> Tested-by: Nicole Cordes <typo3@cordes.co> --- .../Backend/ToolbarItems/SystemInformationToolbarItem.php | 4 +++- .../Templates/ToolbarItems/SystemInformationDropDown.html | 2 +- .../Public/JavaScript/Toolbar/SystemInformationMenu.js | 3 ++- typo3/sysext/belog/Classes/Controller/AbstractController.php | 3 +++ .../belog/Classes/Controller/SystemInformationController.php | 5 +++-- 5 files changed, 12 insertions(+), 5 deletions(-) diff --git a/typo3/sysext/backend/Classes/Backend/ToolbarItems/SystemInformationToolbarItem.php b/typo3/sysext/backend/Classes/Backend/ToolbarItems/SystemInformationToolbarItem.php index 39e644277bbf..7d12140fe37f 100644 --- a/typo3/sysext/backend/Classes/Backend/ToolbarItems/SystemInformationToolbarItem.php +++ b/typo3/sysext/backend/Classes/Backend/ToolbarItems/SystemInformationToolbarItem.php @@ -274,8 +274,9 @@ class SystemInformationToolbarItem implements ToolbarItemInterface * @param string $status The status of this system message * @param int $count Will be added to the total count * @param string $module The associated module + * @param string $params Query string with additional parameters */ - public function addSystemMessage($text, $status = InformationStatus::STATUS_OK, $count = 0, $module = '') + public function addSystemMessage($text, $status = InformationStatus::STATUS_OK, $count = 0, $module = '', $params = '') { $this->totalCount += (int)$count; @@ -288,6 +289,7 @@ class SystemInformationToolbarItem implements ToolbarItemInterface $this->systemMessages[] = [ 'module' => $module, + 'params' => $params, 'count' => (int)$count, 'status' => $messageSeverity, 'text' => $text diff --git a/typo3/sysext/backend/Resources/Private/Templates/ToolbarItems/SystemInformationDropDown.html b/typo3/sysext/backend/Resources/Private/Templates/ToolbarItems/SystemInformationDropDown.html index 4a8fe6998d57..8b8d51f4665c 100644 --- a/typo3/sysext/backend/Resources/Private/Templates/ToolbarItems/SystemInformationDropDown.html +++ b/typo3/sysext/backend/Resources/Private/Templates/ToolbarItems/SystemInformationDropDown.html @@ -46,7 +46,7 @@ <f:then> <p id="systeminformation_{message.module}" class="dropdown-text t3js-systeminformation-module typo3-module-menu-item submodule mod-{message.module}" - data-modulename="{message.module}"> + data-modulename="{message.module}" data-moduleparams="{message.params}"> <span class="text-{message.status}"><f:format.raw>{message.text}</f:format.raw></span> </p> </f:then> diff --git a/typo3/sysext/backend/Resources/Public/JavaScript/Toolbar/SystemInformationMenu.js b/typo3/sysext/backend/Resources/Public/JavaScript/Toolbar/SystemInformationMenu.js index 8128386c31ad..47ca331caf5e 100644 --- a/typo3/sysext/backend/Resources/Public/JavaScript/Toolbar/SystemInformationMenu.js +++ b/typo3/sysext/backend/Resources/Public/JavaScript/Toolbar/SystemInformationMenu.js @@ -122,6 +122,7 @@ define([ var storedSystemInformationSettings = {}, moduleStorageObject = {}, requestedModule = $(e.currentTarget).data('modulename'), + moduleParams = $(e.currentTarget).data('moduleparams'), timestamp = Math.floor((new Date()).getTime() / 1000); if (PersistentStorage.isset('systeminformation')) { @@ -133,7 +134,7 @@ define([ var $ajax = PersistentStorage.set('systeminformation', JSON.stringify(storedSystemInformationSettings)); $ajax.done(function() { // finally, open the module now - TYPO3.ModuleMenu.App.showModule(requestedModule); + TYPO3.ModuleMenu.App.showModule(requestedModule, moduleParams); Viewport.Topbar.refresh(); }); }; diff --git a/typo3/sysext/belog/Classes/Controller/AbstractController.php b/typo3/sysext/belog/Classes/Controller/AbstractController.php index ead7588b1f46..12ce846ad078 100644 --- a/typo3/sysext/belog/Classes/Controller/AbstractController.php +++ b/typo3/sysext/belog/Classes/Controller/AbstractController.php @@ -17,6 +17,7 @@ namespace TYPO3\CMS\Belog\Controller; use TYPO3\CMS\Backend\View\BackendTemplateView; use TYPO3\CMS\Extbase\Mvc\Controller\ActionController; use TYPO3\CMS\Extbase\Mvc\View\ViewInterface; +use TYPO3\CMS\Extbase\Property\TypeConverter\PersistentObjectConverter; /** * Abstract class to show log entries from sys_log @@ -137,6 +138,8 @@ abstract class AbstractController extends ActionController if (!isset($this->settings['timeFormat'])) { $this->settings['timeFormat'] = $GLOBALS['TYPO3_CONF_VARS']['SYS']['hhmm']; } + $constraintConfiguration = $this->arguments->getArgument('constraint')->getPropertyMappingConfiguration(); + $constraintConfiguration->allowProperties('action')->setTypeConverterOption(PersistentObjectConverter::class, PersistentObjectConverter::CONFIGURATION_CREATION_ALLOWED, true); } /** diff --git a/typo3/sysext/belog/Classes/Controller/SystemInformationController.php b/typo3/sysext/belog/Classes/Controller/SystemInformationController.php index ee27c4166fcb..b7f622338340 100644 --- a/typo3/sysext/belog/Classes/Controller/SystemInformationController.php +++ b/typo3/sysext/belog/Classes/Controller/SystemInformationController.php @@ -66,10 +66,11 @@ class SystemInformationController extends AbstractController if ($count > 0) { $systemInformationToolbarItem->addSystemMessage( - sprintf(LocalizationUtility::translate('systemmessage.errorsInPeriod', 'belog'), $count, BackendUtility::getModuleUrl('system_BelogLog')), + sprintf(LocalizationUtility::translate('systemmessage.errorsInPeriod', 'belog'), $count, BackendUtility::getModuleUrl('system_BelogLog', ['tx_belog_system_beloglog' => ['constraint' => ['action' => -1]]])), InformationStatus::STATUS_ERROR, $count, - 'system_BelogLog' + 'system_BelogLog', + http_build_query(['tx_belog_system_beloglog' => ['constraint' => ['action' => -1]]]) ); } } -- GitLab