Review main Merged

48345[TASK] Install Tool: Store numbers and bool values properly

Benni Mack CR +2 V +2 Easy +35 −10 updated 07/20/16, 09:27

Commit message

The install tool ("All Configuration") does not recognize boolean
or integer values, even though they are set in the comments section
of the DefaultConfiguration.php file.

This is changed into bool and even integer numbers to be cast correctly
when using All Configuration and storing the data into LocalConfiguration.php.

Review

  • Code review CR +2
    • Markus Klein +2
    • Georg Ringer +1
    • Wouter Wolters +1
  • Verified V +2
    • Markus Klein +2
    • Georg Ringer +1
    • Wouter Wolters +1
    • TYPO3com +1 CI

Issues 1

Files 2

Review log 3841

Show 16 earlier messages
  1. Benni Mack uploaded patch set 1 05/27/16, 16:27

  2. Wouter Wolters commented on patch set 1 05/29/16, 19:34

    Benni, is it correct that no real boolean values are stored in LocalConfiguration? The commit message suggest that this will be fixed with this patch but I still get a '1' as true...
  3. Wouter Wolters commented on patch set 1 CR -1 06/07/16, 20:10

    on it now
  4. Wouter Wolters uploaded patch set 2 06/07/16, 20:18

  5. Wouter Wolters voted on patch set 2 CR +1 V +1 06/07/16, 20:22

  6. Frank Nägler voted on patch set 2 CR +1 06/09/16, 08:57

  7. Frank Nägler commented on patch set 2 V -1 06/09/16, 09:11

    on testing, please wait with merge
  8. Frank Nägler commented on patch set 2 06/09/16, 09:34

    patch works great for boolean values, but not for integer values. Setting a value (e.g. $GLOBALS['TYPO3_CONF_VARS']['FE']['compressionLevel']) to an integer value not work. The value is saved, but any value is written as string, never as integer. also if the origin value is an integer, after changing the value in the install tool, it is written back as string.
  9. Frank Nägler commented on patch set 2 06/09/16, 12:12

    another bug: the configuration write versionNumberInFilename = false which breaks my system. switching it back to value 0 or '0' let it working again.
  10. Wouter Wolters commented on patch set 2 06/09/16, 21:40

    AllConfiguration.php:168

    this regex does not catch the integer case and string case.
  11. Wouter Wolters uploaded patch set 3 06/09/16, 21:40

  12. Wouter Wolters commented on patch set 3 CR +1 V +1 06/09/16, 21:41

    Can't reproduce the issue with versionNumberInFilename. When true my system breaks because of missing htaccess stuff.
  13. Frank Nägler voted on patch set 3 CR +1 06/10/16, 09:52

  14. Frank Nägler voted on patch set 3 V +1 06/10/16, 09:59

  15. Frank Nägler commented on patch set 3 06/10/16, 10:03

    the patch itself works, but I am not sure about the impact. What is about checks like: if ($foo === '1') vs if ($foo === 1) ? Imho this could be breaking.
  16. Christian Kuhn commented on patch set 3 CR -1 06/10/16, 10:36

    yes, i think we need an overview of those values that are stored as real boolean with the patch and have a look on their usage. and this should happen before the merge so we don't trigger nasty regressions. i'll give a -1 on the patch until that was sorted out.
  1. Frank Nägler commented on patch set 3 06/10/16, 11:26

    not only boolean, also the integer values.
  2. Benni Mack commented on patch set 3 06/27/16, 13:50

    @lolli: I did not find any occurrence where we explicitly check for a bool before. All values are already booleans in DefaultConfiguration and are only loosely checked (if ... or if (!empty(...)). Let me know what to do here.
  3. Christian Kuhn commented on patch set 3 CR 0 06/27/16, 13:54

    i remember frank had a bug after he rolled back the patch, so after his localconfiguration was adapted after first save in install tool all configuration. since i did not fully review the patch and did not played around with it and have no active issue on my radar, i'll remove my -1 now.
  4. Christian Kuhn commented on patch set 3 06/29/16, 11:23

    imho, this issue is more a feature or task than a bugfix - please postpone merge to "after 8.2".
  5. Wouter Wolters commented on patch set 3 06/29/16, 18:34

    I agree, merge after 8.2 release.
  6. Nicole Hummel commented on patch set 3 07/03/16, 17:47

    AllConfiguration.php:118

    shouldn't we case the value as int?

    AllConfiguration.php:167

    Comment should go into elseif
  7. Benni Mack uploaded patch set 4 07/05/16, 06:04

  8. Benni Mack updated the commit message in patch set 5 07/05/16, 06:05

  9. TYPO3com voted on patch set 4 V +1 07/05/16, 06:07 Completed build in 03m 06s on Tue, 5 Jul, 08:07 AM Test Summary: 9651 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-452

  10. TYPO3com voted on patch set 5 V +1 07/05/16, 06:09 Completed build in 04m 20s on Tue, 5 Jul, 08:09 AM Test Summary: 9651 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-453

  11. Markus Klein commented on patch set 5 07/05/16, 07:49

    AllConfiguration.php:162

    should be combined into a single regex: /^(?:<[^>]+>)?(?:boolean|string)/i

    AllConfiguration.php:167

    same here
  12. Markus Klein commented on patch set 5 07/05/16, 07:50

    AllConfiguration.php:162 Reply

    sorry, wrong regex, missed the '!'. But why do we need the second part at all? if we match boolean there can't be string
  13. Elmar Hinz commented on patch set 5 07/05/16, 08:22

    Those regex, that are used repeatedly, could be defined as constants with a speaking name.
  14. Benni Mack commented on patch set 5 07/05/16, 10:09

    AllConfiguration.php:162 Reply

    well, the docs sometimes have boolean/string (like with versionNumberInFilename) - the casting should not happen here.
  15. Benni Mack commented on patch set 5 07/05/16, 10:11

    before this gets out of hand: how about we fix this small thing and in the long run, we should store the descriptions in something else than parsing PHP comments?
  16. Markus Klein commented on patch set 5 07/05/16, 10:41

    A more structured way would indeed be good.
  17. Markus Klein commented on patch set 5 07/05/16, 10:46

    AllConfiguration.php:162 Reply

    Maybe I'm blind, but I only find "// Datatype:..." definitions. Still, even if we had "// Boolean/String:..." the second regex wouldn't match.
  18. Benni Mack commented on patch set 5 07/11/16, 10:36

    AllConfiguration.php:167 Reply

    please check the option enableDeprecationLog
  19. Benni Mack commented on patch set 6 07/11/16, 16:22

    Published edit on patch set 5.
  20. Markus Klein voted on patch set 6 CR +1 07/11/16, 16:30

  21. TYPO3com voted on patch set 6 V +1 07/11/16, 16:43 Completed build in 20m 26s on Mon, 11 Jul, 06:43 PM Test Summary: 18442 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-784

  22. Wouter Wolters voted on patch set 6 CR +1 V +1 07/20/16, 07:50

  23. Georg Ringer voted on patch set 6 CR +1 V +1 07/20/16, 09:12

  24. Markus Klein voted on patch set 6 CR +2 V +2 07/20/16, 09:27

  25. Gerrit merged patch set 6 07/20/16, 09:27