Bug #77758
closedDeleting a workspace spams log
100%
Description
If you delete a workspace, you'll get a log entry for each versionable record. This fills the sys_log-table quite fast.
Steps to reproduce:
1. Create workspace
2. Delete this workspace
3. Log is full with "Attempt to reset workspace for record failed: Not an offline version"
I think, there are two bugs at work here:
The DataHandlerHook does not use the BackendWorkspaceRestriction correctly:
https://github.com/TYPO3/TYPO3.CMS/blob/2206de/typo3/sysext/workspaces/Classes/Hook/DataHandlerHook.php#L108
It should use the workspaceId as parameter.
The resulting SQL-Query looks like this:
SELECT `uid` FROM `pages` WHERE (`pages`.`deleted` = 0) AND ((`pages`.`t3ver_wsid` = 0) OR (`pages`.`t3ver_state` <= 0)) ORDER BY `uid` ASC
After adding the parameter, it looks a bit better:
SELECT `uid` FROM `pages` WHERE (`pages`.`deleted` = 0) AND ((`pages`.`t3ver_wsid` = 9) OR (`pages`.`t3ver_state` <= 0)) ORDER BY `uid` ASC
But the OR within the WHERE-condition still selects all pages, because t3ver_state is 0 for all live-pages. So I think, BackendWorkspaceRestriction is incorrect:
https://github.com/TYPO3/TYPO3.CMS/blob/2206de/typo3/sysext/core/Classes/Database/Query/Restriction/BackendWorkspaceRestriction.php#L68
Before commit ddd05ff314d02abd537fb9432236e6e53c000155 ([TASK] Doctrine: migrate EXT:recordlist/Recordlist/RecordList/AbstractDatabaseRecordList) the query condition looked like this:
1=1 AND pages.t3ver_wsid=10 AND pages.pid=-1 AND `pages`.`deleted` = 0
Updated by Robert Vock about 8 years ago
Maybe #69310 is related, but I am not sure, because that bug got reported, before the doctrine change.
Updated by Gerrit Code Review about 8 years ago
- Status changed from New to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/49727
Updated by Wouter Wolters about 8 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 2238dceac1d619faed94bb2088ca52372155bf62.