diff --git a/typo3/sysext/belog/Classes/Controller/BackendLogController.php b/typo3/sysext/belog/Classes/Controller/BackendLogController.php index 66a1b3bab526c0c7779caab319f69b3c592a81c4..a48cb9374f6e59d25826388f08f64976743d1a42 100644 --- a/typo3/sysext/belog/Classes/Controller/BackendLogController.php +++ b/typo3/sysext/belog/Classes/Controller/BackendLogController.php @@ -23,9 +23,9 @@ use TYPO3\CMS\Backend\Utility\BackendUtility; use TYPO3\CMS\Belog\Domain\Model\Constraint; use TYPO3\CMS\Belog\Domain\Model\LogEntry; use TYPO3\CMS\Belog\Domain\Repository\LogEntryRepository; +use TYPO3\CMS\Core\Authentication\BackendUserAuthentication; use TYPO3\CMS\Core\Database\ConnectionPool; use TYPO3\CMS\Core\Messaging\AbstractMessage; -use TYPO3\CMS\Core\Page\PageRenderer; use TYPO3\CMS\Core\Utility\ExtensionManagementUtility; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Extbase\Http\ForwardResponse; @@ -62,29 +62,28 @@ class BackendLogController extends ActionController $this->settings['dateTimeFormat'] = 'h:m d-m-Y'; $constraintConfiguration = $this->arguments->getArgument('constraint')->getPropertyMappingConfiguration(); $constraintConfiguration->allowAllProperties(); - $pageRenderer = GeneralUtility::makeInstance(PageRenderer::class); - $pageRenderer->loadJavaScriptModule('@typo3/backend/global-event-handler.js'); - $pageRenderer->loadJavaScriptModule('@typo3/belog/backend-log.js'); } /** * Show general information and the installed modules * * @param Constraint|null $constraint - * @param int|null $pageId - * @param string $layout * @param string $operation * @return ResponseInterface */ - public function listAction(Constraint $constraint = null, int $pageId = null, string $layout = 'Module', string $operation = ''): ResponseInterface + public function listAction(Constraint $constraint = null, string $operation = ''): ResponseInterface { + // @todo Make $pageId and $depth constraints selectable in the filter (UX). The $pageId + // constraint was previously provided as non namespaced argument (usage in Web>Info). + // But System>Log does not use the page tree navigation component. Therefore, a new + // filter field must be added, e.g. using the element browser for the selection. + if ($operation === 'reset-filters') { $constraint = new Constraint(); } elseif ($constraint === null) { $constraint = $this->getConstraintFromBeUserData(); } $this->persistConstraintInBeUserData($constraint); - $constraint->setPageId($pageId); $this->resetConstraintsOnMemoryExhaustionError(); $this->setStartAndEndTimeFromTimeSelector($constraint); $showWorkspaceSelector = $this->forceWorkspaceSelectionIfInWorkspace($constraint); @@ -92,8 +91,6 @@ class BackendLogController extends ActionController $groupedLogEntries = $this->groupLogEntriesDay($logEntries); $assigns = [ 'settings' => $this->settings, - 'pageId' => $pageId, - 'layout' => $layout, 'groupedLogEntries' => $groupedLogEntries, 'constraint' => $constraint, 'userGroups' => $this->createUserAndGroupListForSelectOptions(), @@ -106,17 +103,12 @@ class BackendLogController extends ActionController 'level' => $constraint->getLevel(), 'showWorkspaceSelector' => $showWorkspaceSelector, ]; - if ($layout === 'Module') { - // Main module 'Log' module renders a ModuleTemplate view - $view = $this->moduleTemplateFactory->create($this->request); - $view->setTitle(LocalizationUtility::translate('LLL:EXT:belog/Resources/Private/Language/locallang_mod.xlf:mlang_tabs_tab')); - $view->assignMultiple($assigns); - return $view->renderResponse('BackendLog/List'); - } - // Render default extbase view for log module in 'info' - $this->view->assignMultiple($assigns); - return $this->htmlResponse(); + return $this->moduleTemplateFactory + ->create($this->request) + ->setTitle(LocalizationUtility::translate('LLL:EXT:belog/Resources/Private/Language/locallang_mod.xlf:mlang_tabs_tab')) + ->assignMultiple($assigns) + ->renderResponse('BackendLog/List'); } /** @@ -160,7 +152,9 @@ class BackendLogController extends ActionController */ protected function persistConstraintInBeUserData(Constraint $constraint): void { - $GLOBALS['BE_USER']->pushModuleData('system_BelogLog', ['constraint' => serialize($constraint)]); + $moduleData = $this->request->getAttribute('moduleData'); + $moduleData->set('constraint', serialize($constraint)); + $this->getBackendUser()->pushModuleData($moduleData->getModuleIdentifier(), $moduleData->toArray()); } /** @@ -291,8 +285,8 @@ class BackendLogController extends ActionController return false; } - if ($GLOBALS['BE_USER']->workspace !== 0) { - $constraint->setWorkspaceUid($GLOBALS['BE_USER']->workspace); + if ($this->getBackendUser()->workspace !== 0) { + $constraint->setWorkspaceUid($this->getBackendUser()->workspace); return false; } return true; @@ -332,4 +326,9 @@ class BackendLogController extends ActionController $constraint->setStartTimestamp($startTime); $constraint->setEndTimestamp($endTime); } + + protected function getBackendUser(): BackendUserAuthentication + { + return $GLOBALS['BE_USER']; + } } diff --git a/typo3/sysext/belog/Classes/Module/BackendLogModuleBootstrap.php b/typo3/sysext/belog/Classes/Module/BackendLogModuleBootstrap.php deleted file mode 100644 index a8ff3184f7f86223756eb70a16d8cf45018ff010..0000000000000000000000000000000000000000 --- a/typo3/sysext/belog/Classes/Module/BackendLogModuleBootstrap.php +++ /dev/null @@ -1,57 +0,0 @@ -<?php - -/* - * This file is part of the TYPO3 CMS project. - * - * It is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License, either version 2 - * of the License, or any later version. - * - * For the full copyright and license information, please read the - * LICENSE.txt file that was distributed with this source code. - * - * The TYPO3 project - inspiring people to share! - */ - -namespace TYPO3\CMS\Belog\Module; - -use Psr\Http\Message\ResponseInterface; -use Psr\Http\Message\ServerRequestInterface; -use TYPO3\CMS\Backend\Module\ModuleProvider; -use TYPO3\CMS\Backend\Routing\UriBuilder; -use TYPO3\CMS\Extbase\Core\Bootstrap as ExtbaseBootstrap; - -/** - * This class is a wrapper for WebInfo controller of belog. - * It is registered in ext_tables.php with \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::insertModuleFunction() - * and called by the info extension. - * - * Extbase currently provides no way to register a "TBE_MODULES_EXT" module directly, - * therefore we need to bootstrap extbase on our own here to jump to the WebInfo controller. - * @internal This class is experimental and is not considered part of the Public TYPO3 API. - */ -class BackendLogModuleBootstrap -{ - public function __construct( - protected readonly UriBuilder $uriBuilder, - protected readonly ModuleProvider $moduleProvider, - protected readonly ExtbaseBootstrap $extbaseBootstrap, - ) { - } - - /** - * Bootstrap extbase and jump to WebInfo controller - */ - public function main(ServerRequestInterface $request): ResponseInterface - { - $queryParams = $request->getQueryParams(); - $queryParams['tx_belog_system_beloglog']['pageId'] = $request->getQueryParams()['id'] ?? $request->getParsedBody()['id'] ?? 0; - $queryParams['tx_belog_system_beloglog']['layout'] = 'Plain'; - - return $this->extbaseBootstrap->handleBackendRequest( - $request - ->withQueryParams($queryParams) - ->withAttribute('module', $this->moduleProvider->getModule('system_BelogLog')) - ); - } -} diff --git a/typo3/sysext/belog/Configuration/Services.yaml b/typo3/sysext/belog/Configuration/Services.yaml index 6e050e8b49c38247362af94d9ea7f5505ab464e8..61bafaede2414a510730b9647c9d5149cc020c48 100644 --- a/typo3/sysext/belog/Configuration/Services.yaml +++ b/typo3/sysext/belog/Configuration/Services.yaml @@ -12,6 +12,3 @@ services: - name: event.listener identifier: 'belog/show-latest-errors' method: 'appendMessage' - - TYPO3\CMS\Belog\Module\BackendLogModuleBootstrap: - public: true diff --git a/typo3/sysext/belog/Resources/Private/Layouts/Plain.html b/typo3/sysext/belog/Resources/Private/Layouts/Plain.html deleted file mode 100644 index 49387804c8459284764a49a5d292dee34918ebec..0000000000000000000000000000000000000000 --- a/typo3/sysext/belog/Resources/Private/Layouts/Plain.html +++ /dev/null @@ -1,9 +0,0 @@ -<html - xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" - data-namespace-typo3-fluid="true"> - -<f:flashMessages /> -<f:variable name="isSubmoduleLayout" value="true" /> -<f:render section="Content" /> - -</html> diff --git a/typo3/sysext/belog/Resources/Private/Partials/Content/Filter.html b/typo3/sysext/belog/Resources/Private/Partials/Content/Filter.html index 7e483208f9a24b13e202932acf5cc1efc0402756..c0291e5d5139c2d2eafe6eb61f9cc37eb92ad13a 100644 --- a/typo3/sysext/belog/Resources/Private/Partials/Content/Filter.html +++ b/typo3/sysext/belog/Resources/Private/Partials/Content/Filter.html @@ -4,17 +4,6 @@ xmlns:belog="http://typo3.org/ns/TYPO3/CMS/Belog/ViewHelpers" data-namespace-typo3-fluid="true"> -<f:comment> - This is an ugly workaround. - The function module in Web->Info already renders a form tag, and there is - no easy way to circumvent this. The page id is needed for the info module - that is not extbase based to figure the permissions. Thus, we have to add - the page Id manually to hint the info module about that. -</f:comment> -<f:if condition="{isSubmoduleLayout}"> - <input type="hidden" name="id" value="{constraint.pageId}" /> -</f:if> - <f:form object="{constraint}" action="list" name="constraint"> <div class="row row-cols-auto align-items-end g-3"> @@ -50,18 +39,6 @@ </div> </f:if> - <f:if condition="{isSubmoduleLayout}"> - <div class="col"> - <label for="belog-depth" class="form-label"><f:translate key="chLog_menuDepth" /></label> - <f:form.select - property="depth" - options="{pageDepths}" - class="form-select" - id="belog-depth" - /> - </div> - </f:if> - <div class="col"> <label for="belog-channel" class="form-label"><f:translate key="channel" /></label> <f:form.select diff --git a/typo3/sysext/belog/Resources/Private/Partials/Content/LogEntries.html b/typo3/sysext/belog/Resources/Private/Partials/Content/LogEntries.html index 06010a28bb7c43af5ee8fc0c2710dcfd9bfd114f..da0777fa87f20dc4cc3bf2a93c1ebcb50f5582d0 100644 --- a/typo3/sysext/belog/Resources/Private/Partials/Content/LogEntries.html +++ b/typo3/sysext/belog/Resources/Private/Partials/Content/LogEntries.html @@ -36,14 +36,7 @@ <f:translate key="chLog_l_user"/> </th> <th> - <f:if condition="{isSubmoduleLayout}"> - <f:then> - <f:translate key="chLog_l_table"/> - </f:then> - <f:else> - <f:translate key="chLog_l_level"/> - </f:else> - </f:if> + <f:translate key="chLog_l_level"/> </th> <th> <f:translate key="chLog_l_channel"/> @@ -100,14 +93,7 @@ </f:if> </td> <td> - <f:if condition="{isSubmoduleLayout}"> - <f:then> - {logItem.tableName} - </f:then> - <f:else> - {logItem.level} - </f:else> - </f:if> + {logItem.level} </td> <td> {logItem.channel} diff --git a/typo3/sysext/belog/Resources/Private/Templates/BackendLog/List.html b/typo3/sysext/belog/Resources/Private/Templates/BackendLog/List.html index 309ba4c752ceba68853ce3f1a3ba4b6cb96239b2..343fc2641b577c71d0d0c0d85c0c577ed9674165 100644 --- a/typo3/sysext/belog/Resources/Private/Templates/BackendLog/List.html +++ b/typo3/sysext/belog/Resources/Private/Templates/BackendLog/List.html @@ -2,8 +2,16 @@ xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true"> -<f:layout name="{layout}"/> +<f:layout name="Module"/> <f:section name="Content"> + + <f:be.pageRenderer + includeJavaScriptModules="{ + 0: '@typo3/backend/global-event-handler.js', + 1: '@typo3/belog/backend-log.js' + }" + /> + <h1> <f:translate key="adminLog" /> </h1> diff --git a/typo3/sysext/belog/composer.json b/typo3/sysext/belog/composer.json index 3c753052a30bb8ed91f674503de8f8f21b4e6478..78314579fe569024f9e05b5431f2de6c6d78334f 100644 --- a/typo3/sysext/belog/composer.json +++ b/typo3/sysext/belog/composer.json @@ -1,7 +1,7 @@ { "name": "typo3/cms-belog", "type": "typo3-cms-framework", - "description": "TYPO3 CMS Log - View logs from the sys_log table in the TYPO3 backend modules System>Log and Web>Info>Log.", + "description": "TYPO3 CMS Log - View logs from the sys_log table in the TYPO3 backend modules System>Log", "homepage": "https://typo3.org", "license": ["GPL-2.0-or-later"], "authors": [{ diff --git a/typo3/sysext/belog/ext_emconf.php b/typo3/sysext/belog/ext_emconf.php index a116913eb8545566519eb000d0f82eafc028cb91..d64fc84faab5097b1c160a88b095dff5ec04da1f 100644 --- a/typo3/sysext/belog/ext_emconf.php +++ b/typo3/sysext/belog/ext_emconf.php @@ -2,7 +2,7 @@ $EM_CONF[$_EXTKEY] = [ 'title' => 'TYPO3 CMS Log', - 'description' => 'View logs from the sys_log table in the TYPO3 backend modules System>Log and Web>Info>Log.', + 'description' => 'View logs from the sys_log table in the TYPO3 backend modules System>Log', 'category' => 'module', 'state' => 'stable', 'author' => 'TYPO3 Core Team', diff --git a/typo3/sysext/belog/ext_tables.php b/typo3/sysext/belog/ext_tables.php deleted file mode 100644 index 78fc9a3b5bc05c6b0dbabb28eeab996148291ace..0000000000000000000000000000000000000000 --- a/typo3/sysext/belog/ext_tables.php +++ /dev/null @@ -1,16 +0,0 @@ -<?php - -declare(strict_types=1); - -use TYPO3\CMS\Belog\Module\BackendLogModuleBootstrap; -use TYPO3\CMS\Core\Utility\ExtensionManagementUtility; - -defined('TYPO3') or die(); - -// Module Web->Info->Log -ExtensionManagementUtility::insertModuleFunction( - 'web_info', - BackendLogModuleBootstrap::class, - '', - 'Log' -); diff --git a/typo3/sysext/core/Documentation/Changelog/12.0/Important-97031-RemovedLogSubmoduleFromInfoModule.rst b/typo3/sysext/core/Documentation/Changelog/12.0/Important-97031-RemovedLogSubmoduleFromInfoModule.rst new file mode 100644 index 0000000000000000000000000000000000000000..aca49c6455439dc92e8d556a0d5dba4cffc71fbc --- /dev/null +++ b/typo3/sysext/core/Documentation/Changelog/12.0/Important-97031-RemovedLogSubmoduleFromInfoModule.rst @@ -0,0 +1,16 @@ +.. include:: ../../Includes.txt + +============================================================ +Important: #97031 - Removed "Log" submodule from info module +============================================================ + +See :issue:`97031` + +Description +=========== + +The info module in the TYPO3 backend does no longer provide the "Log" +submodule. It has been removed since related page and record logs can +be accessed via the history module since TYPO3 v9. + +.. index:: Backend, ext:belog diff --git a/typo3/sysext/core/Tests/Acceptance/Application/Info/InfoModuleCest.php b/typo3/sysext/core/Tests/Acceptance/Application/Info/InfoModuleCest.php index 342ebecebfcb6fcbdbda0d5edcbd8cbeccabd351..381104d30bebbc1b4d14d0f71f487a88debd96ab 100644 --- a/typo3/sysext/core/Tests/Acceptance/Application/Info/InfoModuleCest.php +++ b/typo3/sysext/core/Tests/Acceptance/Application/Info/InfoModuleCest.php @@ -56,7 +56,6 @@ class InfoModuleCest ['option' => 'Pagetree Overview', 'expect' => 'Pagetree Overview'], ['option' => 'Localization Overview', 'expect' => 'Localization Overview'], ['option' => 'Page TSconfig', 'expect' => 'Page TSconfig'], - ['option' => 'Log', 'expect' => 'Administration log'], ]; } }