Review main Abandoned

61484[TASK] TcaMigration: Cast/convert TCA array elements to bool, int, float

Daniel Windloff CR 0 V 0 Hard +559 −15 updated 03/07/20, 14:00

Commit message

As TCA is a php array, there is no type safety by default.

In order to force the use of the correct type, the type of the TCA
values are set to the expected one via TcaMigration.

The goal of this change is not to create a context sensitive validation
of the given TCA.

It should address common issues as pseudo booleans like 'exclude' => 1
or pseudo integer values like 'cols' => '40'.

Review

  • Code review CR 0
  • Verified V 0

Issues 1

Files 7

Review log 79

  1. Daniel Windloff uploaded patch set 1 08/10/19, 06:44

  2. TYPO3com voted on patch set 1 V -1 08/10/19, 06:55 Completed build in 11m 13s on Sat, 10 Aug, 06:55 AM Test Summary: 77 of 47555 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-35665

  3. Mathias Brodala commented on patch set 1 CR -1 08/12/19, 07:10

    TcaMigration.php:57

    This should be "normalizeScalarTypes" or similar.

    TcaMigration.php:119

    This is wrong since settype() changes the value type in place, it does not return the changed value but true/false on success/failure. So basically this would replace everything with a boolean "true"

    TcaMigrationConfiguration.php:31

    Should be "getValueTypes()"

    TcaMigrationConfiguration.php:34

    This should be "bool"

    TcaMigrationConfiguration.php:40

    This should be "int"

    TcaMigrationConfiguration.php:64

    Typo

    TcaMigrationConfiguration.php:67

    This should be "float"

    TcaMigrationConfiguration.php:292

    This method does not do what it advertises. Also I'm having a hard time understanding this method name.
  4. Daniel Windloff uploaded patch set 2 08/13/19, 05:24

  5. Daniel Windloff commented on patch set 2 08/13/19, 05:32

    Thx for your review. I also add a little adjustment to the ArrayBrowser.

    TcaMigration.php:57 Reply

    Done

    TcaMigration.php:119 Reply

    Oh, right. It seems, that I was somehow inattentive there ;)

    TcaMigrationConfiguration.php:31 Reply

    Done

    TcaMigrationConfiguration.php:34 Reply

    I'd like to use php:gettype() to get the current type of the TCA value. Then I'd like to compare that value with the expeced one. That is why I used boolean instead of bool, integer insted of int and double instead of float.

    TcaMigrationConfiguration.php:40 Reply

    Ack

    TcaMigrationConfiguration.php:64 Reply

    Done

    TcaMigrationConfiguration.php:67 Reply

    Ack

    TcaMigrationConfiguration.php:292 Reply Unresolved

    I was unsure how to name it
  6. TYPO3com voted on patch set 2 V +1 08/13/19, 05:36 Completed build in 12m 07s on Tue, 13 Aug, 05:36 AM Test Summary: 47196 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-35685

  7. Oliver Klee commented on patch set 2 08/13/19, 09:38

    TcaMigrationConfiguration.php:29 Unresolved

    We can make this even more specific (in the annotation, not the return type annotation): string[]

    TcaMigrationConfiguration.php:290 Unresolved

    Here as well: string[]
  8. Susi Moog commented on patch set 2 10/25/19, 21:50

    Can you rebase / resolve the merge conflicts please?
  9. Benni Mack abandoned the change 03/07/20, 14:00

    I'll abandon this change for the time being, as there was no movement in the past 5 months.