Commit 1553fd49 authored by Felix Althaus's avatar Felix Althaus Committed by Nicole Cordes
Browse files

[BUGFIX] System information: set error filter in link to log

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: default avatarTYPO3com <no-reply@typo3.com>
Reviewed-by: default avatarSebastian Hofer <sebastian.hofer@marit.ag>
Tested-by: default avatarSebastian Hofer <sebastian.hofer@marit.ag>
Reviewed-by: Nicole Cordes's avatarNicole Cordes <typo3@cordes.co>
Tested-by: Nicole Cordes's avatarNicole Cordes <typo3@cordes.co>
parent 08a132d3
......@@ -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
......
......@@ -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>
......
......@@ -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();
});
};
......
......@@ -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);
}
/**
......
......@@ -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]]])
);
}
}
......
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