Project

General

Profile

Actions

Bug #55298

closed

sys_history broken because of sys_log task

Added by Stefan Froemken almost 11 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Logging
Target version:
Start date:
2014-01-24
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
5.4
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

Hello Coreteam,

we have activated scheduler task to clean up sys_log, so only last 90 days are in log.
Now we have found out that the history of some older records were deleted, but still available in sys_history.
I have searched the core and found method getHistoryData in RecordHistory.php. There you build following Query:

$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('sys_history.*, sys_log.userid', 'sys_history, sys_log', 'sys_history.sys_log_uid = sys_log.uid
    AND sys_history.tablename = ' . $GLOBALS['TYPO3_DB']->fullQuoteStr($table, 'sys_history') . '
    AND sys_history.recuid = ' . intval($uid), '', 'sys_log.uid DESC', $this->maxSteps);

As you can see, this query can only build entries from sys_history where a relation to a sys_log entry exists. The entry from sys_log was deleted, so output of module history is incomplete.

So what to do?
- When deleting sys_log entries also delete related sys_history
- Modify task to only delete non related entries.

Stefan


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #71950: sys_log doesn't show latest sys_history Entry if there are multiply with the same sys_log_uidClosed2015-11-29

Actions
Actions

Also available in: Atom PDF