Bug #71950
closed
sys_log doesn't show latest sys_history Entry if there are multiply with the same sys_log_uid
Added by Andreas Allacher almost 9 years ago.
Updated about 6 years ago.
Category:
Backend User Interface
Sprint Focus:
On Location Sprint
Description
Due to the fact that sys_history Relation (via Icon) is done by transmitting the sh_uid which is retrieved by quering sys_history for sys_log_uid
and that is done by using the magic function findOneBySysLogUid or via direct query without any order by.
The icon might link to older records instead if sys_log has been truncated previously but not sys_history.
The easiest solution for now would be to query for the latest record in sys_history with the corresponding sys_log_uid.
It is realted to https://forge.typo3.org/issues/55298
However, where as #55298 proposes to decouple sys_history and sys_log (which is a good idea) for a first solution to 6.2 and 7.6
it would be good to just get the latest entry of the sys_log_uid in
\TYPO3\CMS\Backend\History\RecordHistory
and
\TYPO3\CMS\Belog\ViewHelpers\HistoryEntryViewHelper
so just ORDER BY tstamp DESC in RecordHistory and a corrsponding method for the HistoryEntryRepository which then will by called in HistoryEntryViewHelper.
OK. My issue was mostly with the Icon in the sys log that goes to the wrong sys history but of course the issue in RecordHistory itself is even more problematic due to the query.
It could be solved for now by checking the latest sys_log_uid in sys_hsitory and using that prior to inserting into sys_log.
However, it would be better to just decouple them.
For now, however one could make the user id "optional" in RecordHistory by using a left join and current backend user id if there is none.
Of course, the icon from Sys Log Module to RecordHistory still would have to be fixed to latest.
That would have to be fixed in either case and should be relatively simple.
Just to be sure this ticket mostly relates to the wrong Link in the sys log to the sys history which would still be an issue after solving #55298 and could actually be fixed now.
- Status changed from New to Under Review
- Sprint Focus set to On Location Sprint
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
- Status changed from Resolved to Closed
Also available in: Atom
PDF