Review main Merged

74441[BUGFIX] Remove invalid definition of method body functionality

Simon Schaufelberger CR +2 V +2 Easy +0 −1 updated 05/02/22, 14:07

Commit message

The method parseDataStructureByIdentifier defines that files can
also be loaded with the "EXT:" prefix. This is currently not
supported and not documented, thus should be removed. The only
valid syntax is with "FILE:EXT:"

Review

  • Code review CR +2 Done
    • Benni Mack +2
    • Stefan Bürk +1
  • Verified V +2 Done
    • Benni Mack +2
    • Stefan Bürk +1
    • core-ci +1 CI

Issues 1

Files 1

Review log 1524

  1. Simon Schaufelberger uploaded patch set 1 04/26/22, 22:03

  2. core-ci voted on patch set 1 V -1 04/26/22, 22:20 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/26484

  3. core-ci commented on patch set 1 04/26/22, 22:25 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/26484

  4. Simon Schaufelberger uploaded patch set 2 04/27/22, 01:11

  5. Stefan Bürk commented on patch set 2 04/27/22, 01:17

    FlexFormTools.php:563

    Commit message states that EXT prefix is "documented" - at least in the docblock of this method. Do we have more "documentation" of it, beside this method docblock description ? However, this text also states that is is "slightly" different b/w comapt sytanx" - honsestly, do not get which this should mean. However, added code in the end handles it the same way as FILE:EXT: prefix for sheets. Can you enlight me where this compatc logic is handled ?

    FlexFormTools.php:702

    Block L696 -> L702 is the same as L687 -> L693. At least a new exception code must be used for the cloned code, which core ci is complaining about. Do you think we can came up with a code variant avoiding the duplicated code - and eventually using the same exception code for both variants ? (just saw you uploaded a change - so extending this comment): Simply increase a exception by one is not how the core handles exception codes. Exception codes are the current unix-timestamp when adding the code. You may use ``` date +%s ``` for it to retrieve one - at least on a linux/mac system. Not sure about windows.
  6. core-ci voted on patch set 2 V -1 04/27/22, 01:43 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/26492

  7. core-ci commented on patch set 2 04/27/22, 02:29 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/26492

  8. Simon Schaufelberger commented on patch set 2 04/27/22, 11:21

    FlexFormTools.php:563 Reply

    I googled a bit and couldn't find any documentation for it. I also didn't really understand what it means but as you see in the forge issue, somebody found it ;) Honestly, I feel like to just remove this line in the docblock and call this "fixed" as it's undocumented (afaik) and you can just use the "FILE:EXT:" syntax.

    FlexFormTools.php:702 Reply

    I tried to think about a "both" solution but the substring is different for both cases. Does somebody care which date the exception code represents as long as it's unique?
  9. Stefan Bürk commented on patch set 2 04/27/22, 13:39

    FlexFormTools.php:702 Reply

    Sure. Given block/lines do not include the $file line and thus the substrig. that must me done with a switch. ``` $file = ''; if (str_starts_with(trim($dataStructure), 'FILE:')) { $file = GeneralUtility::getFileAbsFileName(substr(trim($dataStructure), 5)); } elseif ((str_starts_with(trim($dataStructure), 'EXT:'))) { $file = GeneralUtility::getFileAbsFileName(substr(trim($dataStructure), 0)); } if (empty($file) || !@is_file($file)) { throw new \RuntimeException( 'Data structure file ' . $file . ' could not be resolved to an existing file', 1478105826 ); } $dataStructure = (string)file_get_contents($file); ``` In the end, it must be unique. However, it's practice to use the current timestamp. Side effect is, the code automaticlly states (round about) when the exception was added to the core. Not sure about a hard rule here, but in the end this is the way it has be done and I think keep that up would not be that bad.
  10. core-ci voted on patch set 2 V +1 04/27/22, 14:15 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/26492

  11. Simon Schaufelberger uploaded patch set 3 04/28/22, 00:07

  12. Simon Schaufelberger commented on patch set 2 04/28/22, 00:08

    FlexFormTools.php:702 Reply

    Done
  13. core-ci voted on patch set 3 V -1 04/28/22, 00:13 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/26541

  14. Simon Schaufelberger commented on patch set 3 04/28/22, 00:26

    FlexFormTools.php:563 Reply

    even in the oldest available documentation https://docs.typo3.org/m/typo3/reference-tca/6.2/en-us/Reference/Columns/Flex/Index.html#ds this is documented with "FILE:EXT:" prefix so in my opinion the code should be reverted and line 563 dropped.
  15. Simon Schaufelberger uploaded patch set 4 04/28/22, 00:33

  16. Simon Schaufelberger commented on patch set 4 04/28/22, 00:34

    FlexFormTools.php:563 Reply

    Done
  17. core-ci voted on patch set 4 V +1 04/28/22, 00:45 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/26542

  18. Simon Schaufelberger rebased onto patch set 5 04/30/22, 15:17

  19. core-ci voted on patch set 5 V -1 04/30/22, 15:51 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/26695

  20. core-ci voted on patch set 5 V +1 04/30/22, 16:56 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/26695

  21. Stefan Bürk voted on patch set 5 V +1 CR +1 04/30/22, 19:30

  22. Benni Mack voted on patch set 5 V +2 CR +2 05/02/22, 14:07

  23. Benni Mack merged patch set 6 05/02/22, 14:07