Project

General

Profile

Actions

Bug #55298

closed

sys_history broken because of sys_log task

Added by Stefan Froemken about 10 years ago. Updated over 5 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 #1

Updated by Steffen Müller about 10 years ago

sys_history and sys_log are tightly coupled. I would love to see this decoupled.
Nevertheless this story will not be solved with 6.2.

To solve this for 6.2, I would vote for
a) When deleting sys_log entries also delete related sys_history
and add a note to the task. Not sure how to handle this for 6.1.

What do others think?

Actions #2

Updated by Steffen Müller about 10 years ago

I had a quick look at the backend. It looks like no history record is shown without a corresponding sys_log entry.
If that's true, I would suggest to leave things like they are for now. Once we have decoupled sys_history from sys_log, this can be be solved in a more clean way.

Would it work for you if you set up two tasks, one to clear sys_log, the other to clear sys_history?

Actions #3

Updated by Stefan Froemken about 10 years ago

I think it would be better to add a col to sys_history called "be_user". So we can delete sys_log entries without losing the information WHO has changed what and when.

Actions #4

Updated by Georg Kühnberger about 10 years ago

I highly support Stefan Froemken's suggestion to decouple the two tables; as the current situation is a) Double-entry bookkeeping and b) sys_log is somehow illnamed asuming that all tables with _log in the name might be deleted without loosing the BE-functionality to see the changes & diffs & being able to restore a change.

Actions #5

Updated by Alexander Opitz over 8 years ago

  • Target version changed from 6.2.0 to 8 LTS
Actions #6

Updated by Andreas Allacher over 8 years ago

Sys Log also has an icon to sys history which I think should be kept.
That one, most likely still would to have use the sys_log_uid but as mentioned in #71950 that could actually be easily fixed by retrieving the latest entry for the sys_log_uid in HistoryEntryViewHelper

Actions #7

Updated by Benni Mack almost 7 years ago

  • Target version changed from 8 LTS to next-patchlevel
Actions #8

Updated by Gerrit Code Review over 6 years ago

  • Status changed from New to Under Review

Patch set 15 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53195

Actions #9

Updated by Gerrit Code Review over 6 years ago

Patch set 16 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53195

Actions #10

Updated by Gerrit Code Review over 6 years ago

Patch set 17 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53195

Actions #11

Updated by Gerrit Code Review over 6 years ago

Patch set 18 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53195

Actions #12

Updated by Gerrit Code Review over 6 years ago

Patch set 19 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53195

Actions #13

Updated by Gerrit Code Review over 6 years ago

Patch set 20 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53195

Actions #14

Updated by Gerrit Code Review over 6 years ago

Patch set 21 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53195

Actions #15

Updated by Gerrit Code Review over 6 years ago

Patch set 22 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53195

Actions #16

Updated by Gerrit Code Review over 6 years ago

Patch set 23 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53195

Actions #17

Updated by Gerrit Code Review over 6 years ago

Patch set 24 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53195

Actions #18

Updated by Gerrit Code Review over 6 years ago

Patch set 25 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53195

Actions #19

Updated by Gerrit Code Review over 6 years ago

Patch set 26 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53195

Actions #20

Updated by Gerrit Code Review over 6 years ago

Patch set 27 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53195

Actions #21

Updated by Gerrit Code Review over 6 years ago

Patch set 28 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/53195

Actions #22

Updated by Benni Mack over 6 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #23

Updated by Benni Mack over 5 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF