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 #1

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.

Actions #2

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

Actions #3

Updated by Wouter Wolters about 8 years ago

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

Updated by Benni Mack about 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF