Project

General

Profile

Actions

Bug #76993

closed

Getting a single extbase query result in a workspace for a relation that has been deleted and re-added returns no relation

Added by Erik Frister almost 8 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Workspaces
Target version:
-
Start date:
2016-07-08
Due date:
% Done:

100%

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

Description

This issue is a problem specifically when a domain model entity contains a relation to a single foreign object, and that relation is removed and a new one is added, all while in the workspace.

To reproduce (example):
  • I have a domain model entity "Blog Entry" that contains a single "Author" object.
  • I switch to a workspace
  • I delete the existing author, create a new one and assign that author to the "Blog Entry" that had the deleted author
  • After using "findAll" to get all blog entries, the blog entry above does have NULL as it's author (when previewing in the frontend)

The problem:
Author is a relation that is being mapped to an object by TYPO3 inside the DataMapper. As author is a single relation, the query is set to "LIMIT 1". However, the "first" author in this scenario is the deleted author. It is being found by the query and then later discarded via the Backend->doLanguageAndWorkspaceOverlay. Which is why I get NULL as the result. The query should get ALL results, do the overlay and then return the first only, without using the LIMIT in the query - at least as long as the workspace overlay is being done after the initial query.


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #89456: Translations of IRRE Extbase Records in Workspaces not savedClosed2019-10-18

Actions
Actions #1

Updated by Gerrit Code Review almost 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/48853

Actions #2

Updated by Erik Frister almost 8 years ago

The proposed solution is to remove setting the limit in the QueryResult.

Why:
As long as rows can be unset later on (after they have been selected from SQL), we cannot be sure that we'll always actually get the first when we set a limit. Unsetting rows happens when working with workspaces (as described in the bug ticket when records are deleted), but it also happens for language overlays when using extensions like languagevisibility. Hence, this is not just a workspace issue. This is an issue as long as we post-process the rows coming from the database for workspace and language overlays.

I'm not 100% happy with removing the LIMIT, as it's a performance issue as well. But I didn't see another option that would work around this concern.

Actions #3

Updated by Susanne Moog about 6 years ago

  • Category set to Workspaces
Actions #4

Updated by Benni Mack over 5 years ago

  • Status changed from Under Review to New
Actions #5

Updated by Gerrit Code Review almost 3 years ago

  • Status changed from New to Under Review

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

Actions #6

Updated by Gerrit Code Review almost 3 years ago

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

Actions #7

Updated by Gerrit Code Review almost 3 years ago

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

Actions #8

Updated by Gerrit Code Review almost 3 years ago

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

Actions #9

Updated by Gerrit Code Review over 2 years ago

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

Actions #10

Updated by Gerrit Code Review over 2 years ago

Patch set 1 for branch 10.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/70215

Actions #11

Updated by Benni Mack over 2 years ago

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

Updated by Benni Mack over 2 years ago

  • Status changed from Resolved to Closed
Actions #13

Updated by Benni Mack over 1 year ago

  • Related to Bug #89456: Translations of IRRE Extbase Records in Workspaces not saved added
Actions

Also available in: Atom PDF