[!!!][BUGFIX] Separate sys_history from sys_log db entries
Before, the history module fetched info about "modified records" from sys_history+the authoritive user from a coupled sys_log entry. Info about "insert" and "delete" was fetched from sys_log solely. However, when using a scheduled cleanup task to truncate sys_log then all history information is useless (see bug report). The patch introduces a new RecordHistoryStore as an abstraction for adding history entries (currently done solely within DataHandler). It adds some additional, necessary SQL fields to sys_history to store all information in there and creates an update wizard to migrate all coupled sys_history/sys_log entries to a new sys_history entry itself. Additionally, the whole existing "RecordHistory" class is now only necessary for fetching the so-called ChangeLog, for a page or a specific record, and to do rollbacks, preparing the history records so they can be worked on. The whole logic for fetching the GET/POST parameters is moved into the "ElementHistoryController", everything that is only possible via Fluid is moved from the RecordHistory object and the ElementHistoryController into the view. Referencing from sys_log (Log module) into sys_history is now done the other way around, storing information about the corresponding history entry inside sys_log. As a side-effect, sys_log should load faster. Abstraction basis: - sys_history is the only source of truth about the history of a record - sys_log contains a reference to an history entry now (inside sys_log.log_data) to link from the backend log module - RecordHistoryStore exists for tracking changes to records - RecordHistory is for retrieving, compiling the history/changelog and rollbacks - ElementHistoryController is doing PSR-7 style request/response handling and preparing data for the view - Fluid is handling more view functionality now, removing the need for doing <f:format.raw> everywhere in the templates. Sidenotes: * Data within sys_history is now stored as JSON, not serialized anymore * Adding/deleting was previously stored in sys_log only, is now within sys_history * Moving records is now tracked (but not evaluated yet) * Highlight/Snapshot functionality within the Backend Module was removed This functionality is built so it can also be used within Extbase persistence and in FE in general in a future iteration. Resolves: #55298 Resolves: #71950 Releases: master Change-Id: I354317609099bac10c264b9932e331fa908c98be Reviewed-on: https://review.typo3.org/53195 Reviewed-by:Andreas Fernandez <typo3@scripting-base.de> Tested-by:
Andreas Fernandez <typo3@scripting-base.de> Tested-by:
TYPO3com <no-reply@typo3.com> Reviewed-by:
Joerg Kummer <typo3@enobe.de> Tested-by:
Joerg Kummer <typo3@enobe.de> Reviewed-by:
Benni Mack <benni@typo3.org> Tested-by:
Benni Mack <benni@typo3.org>
Showing
- typo3/sysext/backend/Classes/Controller/ContentElement/ElementHistoryController.php 349 additions, 42 deletions...es/Controller/ContentElement/ElementHistoryController.php
- typo3/sysext/backend/Classes/History/RecordHistory.php 217 additions, 687 deletionstypo3/sysext/backend/Classes/History/RecordHistory.php
- typo3/sysext/backend/Resources/Private/Partials/RecordHistory/Diff.html 6 additions, 3 deletions...ackend/Resources/Private/Partials/RecordHistory/Diff.html
- typo3/sysext/backend/Resources/Private/Partials/RecordHistory/History.html 26 additions, 16 deletions...end/Resources/Private/Partials/RecordHistory/History.html
- typo3/sysext/backend/Resources/Private/Partials/RecordHistory/MultipleDiff.html 3 additions, 3 deletions...esources/Private/Partials/RecordHistory/MultipleDiff.html
- typo3/sysext/backend/Resources/Private/Partials/RecordHistory/Settings.html 3 additions, 4 deletions...nd/Resources/Private/Partials/RecordHistory/Settings.html
- typo3/sysext/backend/Resources/Private/Templates/RecordHistory/Main.html 2 additions, 10 deletions...ckend/Resources/Private/Templates/RecordHistory/Main.html
- typo3/sysext/belog/Classes/Domain/Model/HistoryEntry.php 0 additions, 49 deletionstypo3/sysext/belog/Classes/Domain/Model/HistoryEntry.php
- typo3/sysext/belog/Classes/Domain/Repository/HistoryEntryRepository.php 0 additions, 32 deletions...elog/Classes/Domain/Repository/HistoryEntryRepository.php
- typo3/sysext/belog/Classes/ViewHelpers/FormatDetailsViewHelper.php 3 additions, 1 deletion...ext/belog/Classes/ViewHelpers/FormatDetailsViewHelper.php
- typo3/sysext/belog/Classes/ViewHelpers/HistoryEntryViewHelper.php 0 additions, 102 deletions...sext/belog/Classes/ViewHelpers/HistoryEntryViewHelper.php
- typo3/sysext/belog/Configuration/TypoScript/setup.txt 0 additions, 5 deletionstypo3/sysext/belog/Configuration/TypoScript/setup.txt
- typo3/sysext/belog/Resources/Private/Partials/Content/LogEntries.html 5 additions, 1 deletion.../belog/Resources/Private/Partials/Content/LogEntries.html
- typo3/sysext/belog/Tests/Unit/Domain/Repository/HistoryEntryRepositoryTest.php 0 additions, 47 deletions...sts/Unit/Domain/Repository/HistoryEntryRepositoryTest.php
- typo3/sysext/core/Classes/DataHandling/DataHandler.php 44 additions, 14 deletionstypo3/sysext/core/Classes/DataHandling/DataHandler.php
- typo3/sysext/core/Classes/History/RecordHistoryStore.php 183 additions, 0 deletionstypo3/sysext/core/Classes/History/RecordHistoryStore.php
- typo3/sysext/core/Configuration/TCA/sys_history.php 1 addition, 19 deletionstypo3/sysext/core/Configuration/TCA/sys_history.php
- typo3/sysext/core/Documentation/Changelog/master/Breaking-55298-DecoupledHistoryFunctionality.rst 99 additions, 0 deletions...g/master/Breaking-55298-DecoupledHistoryFunctionality.rst
- typo3/sysext/core/ext_tables.sql 8 additions, 7 deletionstypo3/sysext/core/ext_tables.sql
- typo3/sysext/install/Classes/Updates/SeparateSysHistoryFromSysLogUpdate.php 175 additions, 0 deletions...ll/Classes/Updates/SeparateSysHistoryFromSysLogUpdate.php
Please register or sign in to comment