Review main Merged

25681[BUGFIX] Installer: Show correct value for boolean options

Markus Klein CR +2 V +2 Easy +12 −5 updated 01/29/14, 19:54

Commit message

Review

  • Code review CR +2
    • Anja Leichsenring +2
    • Wouter Wolters +1
  • Verified V +2
    • Anja Leichsenring +2
    • Wouter Wolters +1

Issues 1

Files 2

Review log 35

Show 10 earlier messages
  1. Mr. Jenkins commented on patch set 1 11/26/13, 02:12

  2. Philipp Gampe commented on patch set 1 11/26/13, 02:18

    AllConfiguration.php:104

    what is the ideas of the condition? $value && strcmp($value, '0') is always FALSE, isn't it? If $value='1' or TRUE, then the first part evaluates to TRUE and the second to FALSE and if $value is '0', then the first parts is FALSE and the strcmp is skipped.
  3. Philipp Gampe commented on patch set 1 V +1 CR +1 11/26/13, 08:14

    AllConfiguration.php:104 Reply

    OK, forget it ... magic of PHP ... strcmp returns TRUE for TRUE,FALSE and FALSE for '0'.
  4. Markus Klein commented on patch set 1 11/26/13, 15:42

    AllConfiguration.php:104 Reply

    to be more precise: strcmp returns an integer. It returns 0 if the strings are equal and a positive or negative value if unequal. Since booelan is nothing but an integer 0 is defined to be FALSE and anything else will be TRUE. So this perfectly checks for $value to be '0'. And no, this is no PHP magic. This is normal C, C++, ... behaviour.
  5. Markus Klein commented on patch set 1 12/02/13, 13:04

    AllConfiguration.php:104 Reply

    Actually this line can be further reduced: $value alone already checks if it is not '0'. So this reduces to: $value ?: 0;
  6. Markus Klein uploaded patch set 2 12/02/13, 13:05

  7. Markus Klein uploaded patch set 3 12/02/13, 13:07

  8. Mr. Jenkins commented on patch set 2 12/02/13, 13:22

  9. Mr. Jenkins commented on patch set 3 12/02/13, 13:24

  10. Markus Klein rebased onto patch set 3 12/12/13, 01:41

  1. Mr. Jenkins commented on patch set 4 12/12/13, 01:53

  2. Stefan Neufeind commented on patch set 4 V -1 CR -1 01/05/14, 23:17

    Sorry, but I fail to see what you aim to "fix" with the patch. *Before the patch* The "value" for fields like ['EXT']['allowGlobalInstall'] is "1" the patch but initially that field is unchecked. If I then set it, it is written to the config correct as "1". If I unset it, it's correclty written as "0". Of course the "value" for the checkbox is always "1". It's the value for the state which will be written if checked! With this patch now the checkbox gets a value of "0" - which is the inverse and prevents me from actually setting that value.
  3. Markus Klein commented on patch set 4 01/06/14, 23:48

    @Stefan: Lets discuss the problem on forge.
  4. Markus Klein uploaded patch set 5 01/07/14, 00:11

  5. Mr. Jenkins commented on patch set 5 01/07/14, 00:25

  6. Stefan Neufeind uploaded patch set 6 01/13/14, 20:45

  7. Stefan Neufeind commented on patch set 6 V +1 CR +1 01/13/14, 20:47

    needed a rebase
  8. Mr. Jenkins commented on patch set 6 01/13/14, 21:06

  9. Stefan Neufeind commented on patch set 6 01/16/14, 22:54

    somebody, please
  10. Marcin Sągol commented on patch set 6 01/17/14, 18:52

    So this should now just show option name without assignment ? Now it is [BE][showRefreshLoginPopup] without = 0 part ?
  11. Markus Klein commented on patch set 6 01/18/14, 13:58

    @Marcin: Unfortunately yes, but I see no better possibility atm. At least it does not always show = 1, when it is not set. So it is an improvement
  12. Markus Klein commented on patch set 6 01/18/14, 14:00

    AllConfiguration.php:104

    We could do: $value ? 'TRUE' : 'FALSE' Then we'd always have a value displayed. Marcin, what do you think?
  13. Wouter Wolters commented on patch set 6 01/18/14, 14:13

    Overall the patch works only not displaying the FALSE value is missing here

    AllConfiguration.php:104 Reply

    This will not work in fluid, the condition is also checking string FALSE
  14. Marcin Sągol commented on patch set 6 01/18/14, 14:15

    Yes the patch works. Check my comment please.

    AllConfiguration.php:104 Reply

    We can try. The thing is i'm used to schema where i see if property has 0 or 1. If there is no any assignment then i have this feeling: ok we have some option but what value by default it has? Probably 0 but i can't be sure :)
  15. Markus Klein commented on patch set 6 01/19/14, 12:31

    AllConfiguration.php:104 Reply

    hm... I guess we need to modify the fluid template then to not check the value in case of a checkbox
  16. Wouter Wolters uploaded patch set 7 01/27/14, 21:54

  17. Wouter Wolters voted on patch set 7 V +1 CR +1 01/27/14, 21:54

  18. Markus Klein commented on patch set 7 01/27/14, 21:57

    will push a new version

    AllConfiguration.php:104

    no need for the boolean cast anymore.
  19. Markus Klein uploaded patch set 8 01/27/14, 22:00

  20. Wouter Wolters voted on patch set 8 V +1 CR +1 01/27/14, 22:03

  21. Mr. Jenkins commented on patch set 7 01/27/14, 22:18

  22. Mr. Jenkins commented on patch set 8 01/27/14, 22:33

  23. Anja Leichsenring voted on patch set 8 V +1 CR +1 01/29/14, 19:36

  24. Anja Leichsenring voted on patch set 8 V +2 CR +2 01/29/14, 19:54

  25. Anja Leichsenring merged patch set 9 01/29/14, 19:54