Project

General

Profile

Actions

Bug #77758

closed

Deleting a workspace spams log

Added by Robert Vock about 8 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
Workspaces
Target version:
-
Start date:
2016-09-01
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
8
PHP Version:
Tags:
doctrine
Complexity:
Is Regression:
Yes
Sprint Focus:

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


Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Bug #69310: Attempt to reset workspace failedClosed2015-08-25

Actions
Follows TYPO3 Core - Task #76259: Doctrine: migrate EXT:recordlist/Recordlist/RecordList/AbstractDatabaseRecordListClosed2016-05-22

Actions
Actions

Also available in: Atom PDF