Review main Abandoned

52791[BUGFIX] Fetch original row from database when previewing a workspace

Xavier Perseguers CR 0 V 0 Easy +32 −11 updated 04/30/21, 10:50

Commit message

In the context of Extbase persistence layer fetching translated relations
within a workspace, the data to be overlaid may contain additional columns
from the MM relation table.

In order to prevent those columns to be queried, the vanilla record
should be fetched prior to try to overlay it.

If needed, additional columns from the JOIN are restored after the overlay
has been prepared.

Review

  • Code review CR 0
  • Verified V 0

Issues 1

Files 1

Review log 4461

Show 2936 earlier messages
  1. Xavier Perseguers uploaded patch set 1 05/12/17, 10:41

  2. TYPO3com voted on patch set 1 V -1 05/12/17, 10:47 Completed build in 06m 24s on Fri, 12 May, 12:47 PM Test Summary: 1 of 55853 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-11457

  3. Xavier Perseguers updated the commit message in patch set 2 05/18/17, 14:21

  4. TYPO3com voted on patch set 2 V +1 05/18/17, 14:26 Completed build in 05m 12s on Thu, 18 May, 04:26 PM Test Summary: 55886 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-11575

  5. Christian Weiske commented on patch set 2 V +1 09/04/17, 13:55

    Makes the error go away here. Thanks!
  6. Benjamin Kluge commented on patch set 2 CR +1 V +1 09/18/17, 09:51

    Works and look ok
  7. Lorenz Ulrich commented on patch set 2 CR +1 V +1 10/12/17, 17:25

    Tested, works!
  8. Jörg Bösche voted on patch set 2 CR +1 10/16/17, 09:03

  9. Susi Moog uploaded patch set 3 10/16/17, 21:37

  10. TYPO3com voted on patch set 3 V -1 10/16/17, 21:37 Completed build in 08s on Mon, 16 Oct, 11:37 PM Test Summary: No tests found Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-15705

  11. Susi Moog uploaded patch set 4 10/16/17, 21:41

  12. Susi Moog commented on patch set 4 10/16/17, 21:44

    Typo3DbBackend.php:615

    this won't work in workspace in default lang context as far as I can see- as the where clause will be uid = 0 (transOrigPointerField exists but is not set to anything sensible), that in turn will result in row being set to empty, causing the SQL error from versionOL to go away but only because it simply isn't overlaying anything anymore. I tried to illustrate the behavior with a functional test case - please have a look at whether the test correctly defines wanted behavior.
  13. Susi Moog voted on patch set 4 V -1 10/16/17, 21:44

  14. TYPO3com voted on patch set 4 V -1 10/16/17, 21:50 Completed build in 09m 26s on Mon, 16 Oct, 11:50 PM Test Summary: 2 of 56973 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-15706

  15. Susi Moog commented on patch set 4 12/08/17, 12:49

    ping @Xavier - do you want to continue here?
  16. Kevin Quiatkowski commented on patch set 4 V +1 CR +1 01/22/18, 14:52

    Tested on 8.7.9, Works!
  17. Oliver Klee commented on patch set 4 01/22/18, 15:27

    WorkspaceRelationTest.php:1

    strict mode, please.
  18. Cristian Buja commented on patch set 4 V +1 CR +1 02/27/18, 09:18

    Test on 8.7.10, works.
  19. Erwin Hontheim commented on patch set 4 03/06/18, 12:14

    Doesn't work for me Typo3 V8.7.10 An exception occurred while executing 'SELECT `uid_local`, `uid_foreign`, `tablenames`, `sorting`, `sorting_foreign`, `fieldname`, `uid`, `pid`, `tstamp`, `crdate`, `cruser_id`, `deleted`, `hidden`, `starttime`, `endtime`, `t3ver_oid`, `t3ver_id`, `t3ver_wsid`, `t3ver_label`, `t3ver_state`, `t3ver_stage`, `t3ver_count`, `t3ver_tstamp`, `t3ver_move_id`, `t3_origuid`, `sys_language_uid`, `l10n_parent`, `l10n_diffsource`, `title`, `description`, `parent`, `items`, `fe_group`, `images`, `single_pid`, `shortcut`, `import_id`, `import_source`, `seo_title`, `seo_description`, `seo_headline`, `seo_text`, `l10n_state`, `tx_odsosm_marker`, `gme_marker`, `gme_image_size`, `gme_image_width`, `gme_image_height`, `marker_icon` FROM `sys_category` WHERE (`pid` = ?) AND (`t3ver_oid` = ?) AND (`t3ver_wsid` = ?) AND (`sys_category`.`deleted` = 0) LIMIT 1' with params [-1, 13, 1]: Unknown column 'uid_local' in 'field list'
  20. Oliver Hader commented on patch set 4 CR -1 03/07/18, 11:25

    Please see my comment at https://forge.typo3.org/issues/81208#note-12 - how can this issue be reproduced (step-by-step)? The test added to this change just concerns only parts of the overall behavior...
  21. Reindl Bernd commented on patch set 4 03/21/18, 12:14

    The problem that Erwin Hontheim has arises from an M: N relation in extbase. In Typo3DbQueryParser.php, a join is created in rows 195 through 205, which returns all the fields of both tables as a result. uid_local, uid_foreign, tablenames, sorting, sorting_foreign, fieldname from the MM table and the remainder from the table linked using the MM table. In PageRepository.php, line 1574, the field names are created from the array keys. Since the fields from the MM table are also evaluated here as field names, the query results in an SQL error. I have solved the problem by patching the lines 601 to 604 in patch set 4 as in the original and instead adding an elseif statement which in the case of forceRecordReloadInWorkspace = true triggers a load based on the uid. I hope the English is understandable. The Google translator is responsible for that :) if (isset($row[$GLOBALS['TCA'][$tableName]['ctrl']['transOrigPointerField']]) && $row[$GLOBALS['TCA'][$tableName]['ctrl']['transOrigPointerField']] > 0 ) { $queryBuilder = $this->connectionPool->getQueryBuilderForTable($tableName); $queryBuilder->getRestrictions()->removeAll(); $row = $queryBuilder->select($tableName . '.*') ->from($tableName) ->where( $queryBuilder->expr()->eq( $tableName . '.uid', $queryBuilder->createNamedParameter( $row[$GLOBALS['TCA'][$tableName]['ctrl']['transOrigPointerField']], \PDO::PARAM_INT ) ), $queryBuilder->expr()->eq( $tableName . '.' . $GLOBALS['TCA'][$tableName]['ctrl']['languageField'], $queryBuilder->createNamedParameter(0, \PDO::PARAM_INT) ) ) ->setMaxResults(1) ->execute() ->fetch(); } elseif($forceRecordReloadInWorkspace && $isInWorkspaceContext) { $queryBuilder = $this->connectionPool->getQueryBuilderForTable($tableName); $queryBuilder->getRestrictions()->removeAll(); $row = $queryBuilder->select($tableName . '.*') ->from($tableName) ->where( $queryBuilder->expr()->eq( $tableName . '.uid', $queryBuilder->createNamedParameter( $row['uid'], \PDO::PARAM_INT ) ) ) ->setMaxResults(1) ->execute() ->fetch(); }
  22. Erwin Hontheim commented on patch set 4 03/22/18, 12:52

    If you like me to test this please send me the appropriate file. Sorry, but I don't have the right tool to apply a patch via diff. Thanks BR Erwin
  23. Lorenz Ulrich commented on patch set 4 04/12/18, 06:30

    Please also see https://forge.typo3.org/issues/82750 where I added an extension to test this behaviour.
  24. Gianluca Strafella commented on patch set 4 V +1 CR +1 06/08/18, 13:49

    Tested on TYPO3 8.7.15. Works fine.
  25. Susi Moog wrote 07/30/18, 12:55

    Removed reviewer Susanne Moog with the following votes: * Verified-1 by Susanne Moog <susanne.moog@typo3.org>
  26. Frédéric Lebel commented on patch set 4 V +1 CR +1 08/01/18, 13:43

    The problem is still on Typo3 8.7.16, and Typo3 8.7.18. Works with the patch. What is missing to merge this patch?
  27. Jacco van der Post commented on patch set 4 V +1 08/29/18, 13:26

    Patch works with 8.7.19. Thanks! Hopefully this or another solution gets in the core.
  28. Benni Mack wrote 10/26/18, 12:27

    Topic set to workspaces
  29. Benni Mack updated the commit message in patch set 5 12/14/18, 09:59

  30. TYPO3com voted on patch set 5 V -1 12/14/18, 10:03 Completed build in 01m 11s on Fri, 14 Dec, 11:03 AM Test Summary: No tests found Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-30694

  31. Rémy DANIEL voted on patch set 5 V +1 02/01/19, 00:11

  32. Anja Leichsenring wrote 05/19/19, 07:50

    Removed reviewer Anja Leichsenring.
  33. Ralf Merz uploaded patch set 6 10/08/19, 15:43

  34. TYPO3com voted on patch set 6 V -1 10/08/19, 15:53 Completed build in 10m 07s on Tue, 8 Oct, 03:53 PM Test Summary: 63 of 47581 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-37153

  35. Andreas Kienast updated the commit message in patch set 7 10/09/19, 06:59

  36. TYPO3com voted on patch set 7 V -1 10/09/19, 07:09 Completed build in 09m 54s on Wed, 9 Oct, 07:09 AM Test Summary: 63 of 48078 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-37160

  1. Markus Hackel uploaded patch set 8 04/28/20, 10:05

  2. TYPO3com voted on patch set 8 V -1 04/28/20, 10:18 Completed build in 13m 06s on Tue, 28 Apr, 10:18 AM Test Summary: 63 of 74147 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-3093

  3. Oliver Hader rebased onto patch set 9 05/02/20, 13:38

  4. TYPO3com voted on patch set 9 V -1 05/02/20, 13:56 Completed build in 16m 35s on Sat, 2 May, 01:56 PM Test Summary: 63 of 74147 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-3166

  5. Benni Mack updated the commit message in patch set 10 05/25/20, 18:50

  6. TYPO3com voted on patch set 10 V -1 05/25/20, 20:12 Completed build in 1h 04m 21s on Mon, 25 May, 08:12 PM Test Summary: 63 of 74292 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-3542

  7. Benni Mack commented on patch set 10 06/04/20, 19:50

    Check out https://review.typo3.org/c/Packages/TYPO3.CMS/+/57012 which also has tests included
  8. Rémy DANIEL commented on patch set 10 06/05/20, 06:57

    would it be possible to backport it on 9.5 too?
  9. Oliver Klee wrote 08/13/20, 12:17

    Removed reviewer Oliver Klee.
  10. huelsmc uploaded patch set 11 11/19/20, 13:37

  11. TYPO3com voted on patch set 11 V -1 11/19/20, 13:49 Completed build in 11m 44s on Thu, 19 Nov, 01:49 PM Test Summary: 57 of 74204 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-7421

  12. huelsmc uploaded patch set 12 11/19/20, 14:19

  13. TYPO3com commented on patch set 12 11/19/20, 14:36 Completed build in 14m 10s on Thu, 19 Nov, 02:36 PM Test Summary: 57 of 74204 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-7426

  14. huelsmc uploaded patch set 13 11/20/20, 09:45

  15. TYPO3com voted on patch set 13 V -1 11/20/20, 09:46 Completed build in 22s on Fri, 20 Nov, 09:46 AM Test Summary: No tests found Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-7437

  16. huelsmc uploaded patch set 14 11/20/20, 10:07

  17. TYPO3com voted on patch set 14 V -1 11/20/20, 10:08 Completed build in 45s on Fri, 20 Nov, 10:08 AM Test Summary: No tests found Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-7440

  18. huelsmc rebased onto patch set 15 11/20/20, 10:35

  19. TYPO3com voted on patch set 15 V -1 11/20/20, 10:36 Completed build in 26s on Fri, 20 Nov, 10:36 AM Test Summary: No tests found Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-7443

  20. huelsmc uploaded patch set 16 11/20/20, 12:12

  21. Andreas Kienast commented on patch set 16 11/20/20, 12:17

    Unresolved

    Where does this come from?
  22. huelsmc updated the commit message in patch set 17 11/20/20, 12:30

  23. TYPO3com voted on patch set 17 V -1 11/20/20, 12:47 Completed build in 11m 35s on Fri, 20 Nov, 12:46 PM Test Summary: 9 of 32618 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-7456

  24. TYPO3com voted on patch set 17 V +1 11/20/20, 13:10 Completed build in 46m 14s on Fri, 20 Nov, 01:10 PM Test Summary: 32377 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-7456

  25. Benni Mack abandoned the change 04/30/21, 10:50