Review main Abandoned

75381[TASK] Refactor and simplify array access

Tizian Schmidlin CR 0 V 0 Hard +356 −442 updated 07/09/24, 15:54

Commit message

I discovered some "broken" functionality in FlexFormUtility where trying
to read data from the pi_flexform field that has broken data. This leads
to a warning. This could be considered as a user side issue, but I
prefer to ensure that the core does not generate any warnings from the
get go.

Working on this single issue openend a whole new can of worms, as there
are many places like this in core. These places were addressed during
the coding night at T3DD22 in Karlsruhe and are the result of this
commit.

Review

  • Code review CR 0
  • Verified V 0

Issues 1

Files 50

Show 30 more files

Review log 2436

Show 611 earlier messages
  1. Tizian Schmidlin uploaded patch set 1 08/05/22, 22:19

  2. core-ci voted on patch set 1 V -1 08/05/22, 22:30 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29871

  3. Tizian Schmidlin uploaded patch set 2 08/06/22, 11:23

  4. Tizian Schmidlin uploaded patch set 3 08/06/22, 11:25

  5. core-ci voted on patch set 2 V -1 08/06/22, 11:34 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29891

  6. core-ci voted on patch set 3 V -1 08/06/22, 11:36 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29892

  7. Tizian Schmidlin uploaded patch set 4 08/06/22, 11:46

  8. core-ci voted on patch set 4 V -1 08/06/22, 11:56 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29893

  9. Tizian Schmidlin uploaded patch set 5 08/08/22, 07:02

  10. core-ci voted on patch set 5 V -1 08/08/22, 07:12 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29934

  11. Tizian Schmidlin commented on patch set 5 08/08/22, 08:27

    NewContentElementController.php:226 Unresolved

    See https://github.com/kalessil/phpinspectionsea/blob/master/docs/performance.md#slow-array-function-used-in-loop on how this is better on why this is better, performance wise, as before.

    SelectSingleElement.php:185 Unresolved

    We already ensured above that `$selectItemGroup['item']` is available, therefore no need for further check.

    RecordHistory.php:239 Unresolved

    `$this->getHistoryDataForRecord` always returns an array, so checking it is usless. Also an empty array still works in foreach.

    ElementBrowserRecordList.php:82 Unresolved

    Change for consistency.

    BackendUtility.php:152 Unresolved

    This is a valid replacement, since getRecord returns an `array|null`.

    DefaultTcaSchema.php:463 Unresolved

    @benni Any thoughts?

    MarkerBasedTemplateService.php:501 Unresolved

    We don't need to test for `array` here, since the method signature enforces it already.

    TemplateService.php:1014 Unresolved

    It is very unlikely, that $this->setup is not either null or an array (even if it is empty, this is still valid).

    ExtbaseRequestParameters.php:206 Unresolved

    `get_class_methods` always returns an array.

    Typo3DbQueryParser.php:617 Unresolved

    `$columnMap->getRelationTableMatchFields()` always returns an array.

    RequestHandler.php:418 Unresolved

    This either exists and is an array ("dot"-index) or does not exist.

    CleanFlexFormsCommand.php:171 Unresolved

    `BackendUtility::selectVersionsOfRecord` will always return an array or null, therefore we can catch a null beforehand and set an empty array

    ConfigurationStatus.php:147 Unresolved

    `$this->getConfiguredMemcachedServers()` always returns an array
  1. Benni Mack updated the commit message in patch set 6 08/08/22, 08:28

  2. core-ci voted on patch set 6 V -1 08/08/22, 08:37 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29939

  3. Tizian Schmidlin commented on patch set 6 08/25/22, 08:44

    Unresolved

    > Patch Set 6: Verified-1 > > Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29939 Some MariaDB Tests seem to fail, but I have no idea why. Is there a good way to find out, what causes the issue when using MariaDB and PHP 8.1 or a good way to visualize the error?
  4. Oliver Klee commented on patch set 6 08/25/22, 09:29

    The lines in the commit message are a bit too long (so that they wrap in Gerrit). Could you please shorten them?
  5. Tizian Schmidlin uploaded patch set 7 08/25/22, 11:27

  6. core-ci voted on patch set 7 V -1 08/25/22, 11:37 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/30443

  7. Oliver Klee commented on patch set 7 08/25/22, 11:55

    Reply

    Done
  8. Oliver Klee wrote 08/25/22, 11:55

    Removed cc Oliver Klee.
  9. Simon Schaufelberger commented on patch set 7 09/24/22, 23:06

    Unresolved

    why is this breaking if there is no breaking.rst?
  10. Benni Mack uploaded patch set 8 10/06/22, 08:16

  11. core-ci voted on patch set 8 V -1 10/06/22, 08:26 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/32054

  12. Benni Mack uploaded patch set 9 11/14/22, 09:43

  13. core-ci voted on patch set 9 V -1 11/14/22, 09:54 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/33692

  14. Benni Mack commented on patch set 9 07/04/23, 13:16

    ping. either we split this one up into smaller chunks, or we abandon it completely (or we just fix the FlexFormUtility in this patch?)
  15. Stefan Bürk commented on patch set 9 09/27/23, 15:16

    Reply

    @Tizian What should we do with this patch ? Would you trim it down / split it. I would say, we should at least narrow it down to the exact need for the FlexFormUtility.
  16. Benni Mack uploaded patch set 10 V -1 01/08/24, 11:23

  17. core-ci voted on patch set 10 V -1 01/08/24, 11:33 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/51221

  18. Benni Mack uploaded patch set 11 V -1 01/12/24, 14:08

  19. core-ci voted on patch set 11 V -1 01/12/24, 14:18 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/51507

  20. Benni Mack uploaded patch set 12 V -1 01/12/24, 14:38

  21. Benni Mack commented on patch set 12 01/12/24, 14:42

    Reply

    The only error that now occurs in the CI is probably the actual cause. I propose to keep the current patch as cleanup and fix the FlexForm Change then
  22. core-ci voted on patch set 12 V -1 01/12/24, 14:48 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/51511

  23. Benni Mack commented on patch set 12 06/19/24, 21:02

    anyone going to continue on this? I suggest to split this up into smaller chunks (we already fixed a lot of those), and then abandon this change, if no one wants to pick this change up.
  24. Christian Kuhn commented on patch set 12 07/09/24, 15:54

    Hey. I think its fair to abandon here for now: This patch has lots of merge conflicts, and it seems nobody is really picking it up again. In case this should be picked up again, we may simply start over with fresh patches and issues.
  25. Christian Kuhn abandoned the change 07/09/24, 15:54