75256[BUGFIX] Correct workspace overlays in DataMapProcessor
Commit message
Review
-
Code review CR +2 Done
- Christian Kuhn +2
- Stefan Bürk +1
- Oliver Hader +1
-
Verified V +2 Done
- Christian Kuhn +2
- Stefan Bürk +1
- core-ci +1 CI
Issues 2
Files 1
Review log 2428
Show 23 earlier messages
-
Christian Kuhn uploaded patch set 1 07/21/22, 12:58
-
core-ci voted on patch set 1 V -1 07/21/22, 13:05 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29402
-
Christian Kuhn uploaded patch set 2 07/21/22, 13:17
-
Christian Kuhn updated the commit message in patch set 3 07/21/22, 13:18
-
core-ci voted on patch set 3 V +1 07/21/22, 13:25 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29404
-
Oliver Klee commented on patch set 3 07/21/22, 13:39
Please let's cover this with regression tests. -
Benni Mack commented on patch set 3 07/21/22, 13:52
DataMapProcessor.php:903can we use VersionState constants please?DataMapProcessor.php:907Use "$queryBuilder->executeQuery()" and remove "$statement = $queryBuilder->" from line 880 -
Stefan Bürk commented on patch set 3 07/21/22, 14:10
DataMapProcessor.php:902In case of workspaces, "uid" list get provided two times .. meaning, it takes count($uids) * 2 placeholders .. and having this duplication is not really needed: ``` -- current ( uid IN (....) AND t3ver_wsid = 0 ) OR ( uid IN (....) AND t3ver_wsid = <be_user_workspace>) ``` What do you thing, should we better only provide the uid list onces ? Better doing something like: ``` -- version 1 uid IN (....) AND (t3ver_wsid = 0 OR t3ver_wsid = <be_user_workspace) ``` or even better ``` -- version 2 uid IN (....) AND t3ver_wsid IN (0, <be_user_workspace) ``` So for version 2, would be following ... ``` $wsids = [0]; if ($this->backendUser->workspace > 0 && BackendUtility::isTableWorkspaceEnabled($tableName)) { $wsids[] = $this->backendUser->workspace; } $result = $queryBuilder ->select(...array_values($fieldNames)) ->from($tableName) ->where( $queryBuilder->expr()->in( 'uid', $queryBuilder->createNamedParameter($ids, Connection::PARAM_INT_ARRAY) ), $queryBuilder->expr()->in( 't3ver_wsid', $queryBuilder->createNamedParameter($wsids, Connection::PARAM_INT_ARRAY) ) ); ```DataMapProcessor.php:903Reply^ would love this too.DataMapProcessor.php:907Reply``` $statement = $queryBuilder()->executeQuery(); ``` technically wrong nowerdays as executeQuery returns a Result not a statement anymore. So maybe use "$result" and cchange it in L910 to "$result->fetchAssociative()" along the way ? -
Stefan Bürk commented on patch set 3 07/21/22, 14:19
DataMapProcessor.php:902ReplyMy bad .. that won't work .. more like that: ``` $expressions = [ $queryBuilder->expr()->eq('t3ver_wsid', 0), ]; if ($this->backendUser->workspace > 0 && BackendUtility::isTableWorkspaceEnabled($tableName)) { $expressions[] = $queryBuilder->expr()->and( $queryBuilder->expr()->eq('t3ver_wsid', $queryBuilder->createNamedParameter($this->backendUser->workspace, \PDO::PARAM_INT)), $queryBuilder->expr()->in( 't3ver_state', $queryBuilder->createNamedParameter( [0, 1, 4], // use here VersionStateConstants Connection::PARAM_INT_ARRAY ) ), ) } $result = $queryBuilder ->select(...array_values($fieldNames)) ->from($tableName) ->where( $queryBuilder->expr()->in( 'uid', $queryBuilder->createNamedParameter($ids, Connection::PARAM_INT_ARRAY) ), $queryBuilder->or(...$expressions) ); ``` results in ``` uid IN (....) AND ( t3ver_wsid = 0 or ( t3ver_wsid = <be_user_workspace> and t3ver_state IN (0,1,4) ) ) ``` -
Oliver Klee commented on patch set 3 07/21/22, 14:43
Reply
Marking as unresolved. -
Christian Kuhn commented on patch set 3 07/22/22, 10:36
Reply
Well, yes. I'd love to add tests here and you know me, I would have added some if possible ;) This area is about localized workspace record relations with changed l10n_state. This part is still buggy (for instance workspaces tends to duplicate relations when creating overlays even though they have been removed in the interface). The full behavior of this part is untested and partially undefined. The according DataScenarios even for "Regular" (non-relations, just fields) have no workspace pendant, yet. And for relations, it's completely missing. I simply can not provide full test coverage of this area at the moment, that would take at least multiple days. OTOH, this patch is a regression fix from #92209 that fixes a crash. The query result is now the same as before #92209 for this case, and it does not change for other cases. This can be verified by looking at the queries before #92209 and with patch. I thus decided to skip functional coverage for now, but only fix the crash at the moment. Having a detailed look at DataMapProcessor details for workspaces is something we need to look at in detail later, anyways. For now, the fatal needs to be solved and the patch does not make it worse since it essentially re-creates the result from before #92209.DataMapProcessor.php:902ReplyDoneDataMapProcessor.php:903ReplyDoneDataMapProcessor.php:907ReplyDone -
Oliver Klee commented on patch set 3 07/22/22, 10:59
Reply
I know that this area is mostly untested, and I was not asking for full coverage here. :-) I was proposing to have a regression test, i.e., a test that fails/errors as long as we have the fatal, and that passes without it. -
Christian Kuhn commented on patch set 3 07/22/22, 11:05
Reply
sorry, i'll not provide this. it is neither documented nor decided on how that thing should act in this detail. i'm not even sure if the result DataMapProcessor calculates in this case is "correct" in the first place. i could come up with some heavy mocking test, but that's waste of time, too. this needs systematic testing to document behavior and then look at what is going wrong on this base. A detail regression test does not make sense. -
Benni Mack commented on patch set 4 07/22/22, 11:34
Published edit on patch set 3. -
Christian Kuhn commented on patch set 4 07/22/22, 11:42
foo. i forgot to push my local version ... -
Christian Kuhn uploaded patch set 5 07/22/22, 11:43
-
Oliver Klee commented on patch set 5 07/22/22, 11:46
DataMapProcessor.php:886Do we still need the numbers in these comments if we're using the constants below? -
core-ci voted on patch set 5 V +1 07/22/22, 11:50 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29425
-
core-ci voted on patch set 4 V +1 07/22/22, 11:51 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29424
-
Stefan Bürk voted on patch set 5 V +1 CR +1 07/22/22, 16:44
-
Christian Kuhn commented on patch set 5 07/22/22, 18:17
DataMapProcessor.php:886Replywell, they don't harm, i'd say. -
Christian Kuhn commented on patch set 5 V +1 CR +1 07/22/22, 19:10
works for live. but L=x param is still missing when previewing a localized workspace page - different patch? -
Christian Kuhn commented on patch set 5 V 0 CR 0 07/22/22, 19:47
scratch above comment ... this was supposed to go to a different review ... second fail on this patch from my side. sorry ... -
Oliver Hader commented on patch set 5 CR +1 07/23/22, 09:35
This was the OLD approach to tackle workspace related topics with language synchronization... back then there still were pid=-1 and two additional WS-placeholders which have been normalized in the past TYPO3 major versions. I just wanted to reference that change again, since it probably gives more indicators on what might not be working yet. However, I did not follow all recent changes in `DataMapProcessor`. -
Oliver Hader commented on patch set 5 07/23/22, 09:36
Oh, and functional tests for that scenario in combination with different sync strategies (none, language-sync, exclude) would be nice. -
Oliver Hader commented on patch set 5 07/23/22, 09:37
Reply
`none, language-sync, exclude` should have been `exclude, language-sync-parent, langauge-sync-source` -
Christian Kuhn commented on patch set 5 V +2 CR +2 07/23/22, 13:10
i hope it's ok to merge this one: another +1 testing from anyone is rather unlikely, the patch affects a workspace detail only, and if something really goes wrong, i'll take care anyways. -
Christian Kuhn merged patch set 6 07/23/22, 13:11