Issue Bug Closed

#71950sys_log doesn't show latest sys_history Entry if there are multiply with the same sys_log_uid

Andreas Allacher 11/29/15, 10:09 updated 10/02/18, 11:26

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.

Reviews 2