Review main Merged

42471[TASK] Cleanup usage of booleans in EXT:frontend

Stefan Neufeind CR +2 V +2 Normal +42 −42 updated 02/11/16, 22:17

Commit message

Review

  • Code review CR +2
    • Benni Mack +2
    • Markus Klein +1
  • Verified V +2
    • Benni Mack +2
    • Markus Klein +1

Issues 1

Files 6

Review log 31

Show 6 earlier messages
  1. Stefan Neufeind uploaded patch set 1 08/09/15, 22:13

  2. Benni Mack commented on patch set 1 08/10/15, 06:07

    ContentObjectRenderer.php:5145

    One space too much

    AbstractPlugin.php:584

    that's a change of behaviour, right?
  3. Stefan Neufeind commented on patch set 1 08/10/15, 06:40

    AbstractPlugin.php:584 Reply

    Hmm, I had a strange feeling as well at first. But $this->pi_alwaysPrev is documented as being a boolean. Do you think it might be used with negative integers or so? With (>= 0) (and not taking negative values into account) the outer if would always be TRUE then? So we'd need to remove the outer if instead? How is it supposed to behave? If $pointer>0 then there is a prev to show. And if not, it should still be shown (disabled) if $alwaysPrev is set, right?
  4. Benni Mack commented on patch set 1 08/10/15, 07:21

    AbstractPlugin.php:584 Reply

    Easy. This is how it was before: - if ($alwaysPrev >= 0) means, that if you set it to "-1" then it would not show the previous pointer links at all. - If the pointer is > 0, then the link is shown, but if you have the option $alwaysPrev to TRUE (showing it always) then it will show anyways, even though you point to current page (which is stupid as well) So either you change the behaviour, but then let's document it right (as you stated, always boolean etc) and then we should also inspect the other options as well. Or (what I would do) leave this check out for now and let's tackle it separately.
  5. Stefan Neufeind uploaded patch set 2 08/10/15, 07:52

  6. Stefan Neufeind commented on patch set 2 08/10/15, 07:53

    left out the change for $pi_alwaysPrev for now
  1. Wouter Wolters commented on patch set 2 CR +1 08/10/15, 20:58

    TypoScriptFrontendController.php:1239

    this is actually a bugfix here. Could never reach value 2 here
  2. Daniel Goerz voted on patch set 2 CR +1 08/10/15, 21:00

  3. Markus Klein commented on patch set 2 08/15/15, 12:42

    ContentObjectRenderer.php:8386

    return $GLOBALS['TCA'][$table]['ctrl']['enablecolumns']['disabled'] && $row[$GLOBALS['TCA'][$table]['ctrl']['enablecolumns']['disabled']] || $GLOBALS['TCA'][$table]['ctrl']['enablecolumns']['fe_group'] && $GLOBALS['TSFE']->simUserGroup && $row[$GLOBALS['TCA'][$table]['ctrl']['enablecolumns']['fe_group']] == $GLOBALS['TSFE']->simUserGroup || $GLOBALS['TCA'][$table]['ctrl']['enablecolumns']['starttime'] && $row[$GLOBALS['TCA'][$table]['ctrl']['enablecolumns']['starttime']] > $GLOBALS['EXEC_TIME'] || $GLOBALS['TCA'][$table]['ctrl']['enablecolumns']['endtime'] && $row[$GLOBALS['TCA'][$table]['ctrl']['enablecolumns']['endtime']] && $row[$GLOBALS['TCA'][$table]['ctrl']['enablecolumns']['endtime']] < $GLOBALS['EXEC_TIME']
  4. Markus Klein commented on patch set 2 08/15/15, 12:42

    TypoScriptFrontendController.php:1239 Reply

    for 6.2 as well I'd say
  5. Markus Klein commented on patch set 2 08/15/15, 12:46

    TypoScriptFrontendController.php:1239 Reply

    hm... this has been ? TRUE : FALSE, before it was changed to (bool). maybe this can never get the value 2 here?
  6. Stefan Neufeind uploaded patch set 3 10/15/15, 22:57

  7. Xavier Perseguers commented on patch set 3 CR -1 10/21/15, 06:45

    security issue

    ContentObjectRenderer.php:4209

    = false missing

    TypoScriptFrontendController.php:1851

    Not fine with this change because there is a risk we never reach the final "else" and we now allow by default instead of denying (which is the way to go security-wise)
  8. Xavier Perseguers commented on patch set 3 CR 0 10/21/15, 06:46

    just a nitpick now, sorry, no security problem

    TypoScriptFrontendController.php:1851 Reply

    sorry, missed the "!" at the return statement
  9. Stefan Neufeind uploaded patch set 4 11/20/15, 14:41

  10. Stefan Neufeind commented on patch set 4 11/20/15, 14:42

    rebased
  11. Markus Klein commented on patch set 4 11/21/15, 11:25

    ContentObjectRenderer.php:8676

    wouldn't change that. count on DB is faster than in PHP

    TypoScriptFrontendController.php:1291

    is that a bugfix?

    PageGenerator.php:72

    !empty()

    AbstractPlugin.php:546

    !empty()
  12. Stefan Neufeind commented on patch set 4 CR -1 11/21/15, 11:59

    ContentObjectRenderer.php:8676 Reply

    will remove that change. not really needed to change it

    TypoScriptFrontendController.php:1291 Reply

    discussed with Markus; we keep this change

    PageGenerator.php:72 Reply

    will adjust that

    AbstractPlugin.php:546 Reply

    will adjust that
  13. Stefan Neufeind uploaded patch set 5 11/21/15, 12:03

  14. Benni Mack voted on patch set 5 CR +1 02/09/16, 19:18

  15. Daniel Goerz voted on patch set 5 CR +1 02/10/16, 22:12

  16. Benni Mack voted on patch set 5 V +1 02/11/16, 07:48

  17. Frank Nägler commented on patch set 5 CR -1 02/11/16, 12:30

    FrontendUserAuthentication.php:102

    this value is used in getNewSessionRecord(). the return value is later used in exec_INSERTquery(). A bool "false" will not be converted to 0 but to an empty value. this can be tested easy with this test code: https://3v4l.org/SC5dd This can result in an broken SQL query.

    ContentObjectRenderer.php:453

    true

    JavaScriptMenuContentObject.php:137

    used only one time, maybe move the method call to the if statement?
  18. Daniel Goerz voted on patch set 5 CR 0 02/11/16, 12:47

  19. Markus Klein commented on patch set 5 02/11/16, 18:27

    FrontendUserAuthentication.php:102 Reply

    Done

    ContentObjectRenderer.php:453 Reply

    Code has been removed

    JavaScriptMenuContentObject.php:137 Reply

    Not part of this patch set anymore.
  20. Markus Klein uploaded patch set 6 02/11/16, 18:27

  21. Markus Klein voted on patch set 6 CR +1 V +1 02/11/16, 18:34

  22. Benni Mack voted on patch set 6 CR +2 V +2 02/11/16, 21:06

  23. Gerrit merged patch set 6 02/11/16, 21:06

  24. Stefan Neufeind commented on patch set 7 02/11/16, 21:38

    great guys, thanks for taking care
  25. Frank Nägler commented on patch set 7 02/11/16, 22:17

    +1, thx for taking care of my remarks.