Review main Merged

61710[TASK] Make infobox for shortcut pages more helpful

Oli Bartsch CR +2 V +2 Normal +59 −29 updated 09/25/19, 09:32

Commit message

Add proper information for the user about the target page.

In case the target page doesn't exist or is not accessible
in the frontend, the infobox in the page module now states this out.

Review

  • Code review CR +2 Done
    • Frank Nägler +2
    • Andreas Kienast +1
  • Verified V +2 Done
    • Frank Nägler +2
    • Andreas Kienast +1
    • TYPO3com +1 CI

Issues 1

Files 2

Review log 2533

Show 58 earlier messages
  1. Oli Bartsch uploaded patch set 1 09/16/19, 06:29

  2. Oli Bartsch updated the commit message in patch set 2 09/16/19, 06:31

  3. TYPO3com voted on patch set 1 V +1 09/16/19, 06:46 Completed build in 13m 16s on Mon, 16 Sep, 06:46 AM Test Summary: 47556 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-36457

  4. Stefan P commented on patch set 2 09/16/19, 06:50

    PageLayoutController.php:1250

    Checking only for hidden is not fully matching the description of this method. The full set of enable fields (start/endtime) has to be checked or the description has to adjusted (depending on what is actually be intended here). Exlcuding fe groups, they are obviodusly not available in BE context. In the current state this can be simplyfied to: return !($targetPage[''hidden'] ?? true) ? $targetPage : []
  5. TYPO3com voted on patch set 2 V -1 09/16/19, 06:55 Completed build in 21m 51s on Mon, 16 Sep, 06:55 AM Test Summary: 47319 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-36458

  6. Oli Bartsch uploaded patch set 3 09/16/19, 07:20

  7. Oli Bartsch commented on patch set 3 09/16/19, 07:26

    PageLayoutController.php:1250 Reply

    The other enable fields get checked by `getPage` and `getMenu` inside the switch..case. Because `getPage` doesn't include the check for `hidden` we need this method to also check for this property. I changed the name and the description of this method to avoid misunderstandings and changed the body to your proposal.
  8. TYPO3com voted on patch set 3 V +1 09/16/19, 07:31 Completed build in 10m 43s on Mon, 16 Sep, 07:31 AM Test Summary: 47555 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-36462

  1. Stefan P voted on patch set 3 CR +1 09/16/19, 07:41

  2. Frank Nägler commented on patch set 3 CR -1 09/20/19, 08:56

    PageLayoutController.php:492

    please no Yoda conditions, means use: `$targetPage === []` instead of `[] === $targetPage` or maybe much better use `empty($targetPage)` check here. And very important: use htmlspecicalchars() for all values you add to $message to prevenet XSS.
  3. Stefan P commented on patch set 3 09/20/19, 09:54

    PageLayoutController.php:492 Reply

    I have no preference for yoda or regular, but please not empty() as this implies so much obscure auto-magic of what "empty" means. Please stick to correct types. If we have an array then we compare to "=== []" or "\count($array) === 0" About htmlspecialchars: yes, but please only at the very last point when $message is actually used, not on every single write access.
  4. Frank Nägler commented on patch set 3 09/20/19, 10:01

    PageLayoutController.php:492 Reply

    empty is a common variant in the core, but I am fine if $targetPage is every time an array and we can ensure to be type-safe. hsc must be applied, if you add it in the last step I am fine, but ensure that we don't have double encoding, in some places the hsc is already applied to $message.

    PageLayoutController.php:1248

    method name implies a bool return value, so change method name or return type.
  5. Oli Bartsch uploaded patch set 4 09/22/19, 14:09

  6. Oli Bartsch commented on patch set 4 09/22/19, 14:14

    PageLayoutController.php:492 Reply

    Hi Frank, thank you for your feedback! I changed the yoda conditions to regular ones. I personally use type-safe conditions wherever possible because this improves the readability a lot. An as Stefan already pointed out the `empty` is such an auto-magic function which can also be applied to e.g. strings. With the type-safe way it is clear what should or shouldn't be empty. Where exactly do you miss a hsc? All possible user input values are already treated by hsc (Line 515). The other values which are applied to `$message` are from local lang. Should they really get handled by hsc too?

    PageLayoutController.php:1248 Reply

    I changed the method name and PHPDoc comment to be more clear what it really does.
  7. TYPO3com voted on patch set 4 V +1 09/22/19, 14:19 Completed build in 09m 51s on Sun, 22 Sep, 02:19 PM Test Summary: 47739 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-36624

  8. Frank Nägler commented on patch set 4 09/23/19, 13:48

    PageLayoutController.php:492 Reply

    every $message assignment with $lang->getLL() for example has no hsc. And language labels are also user input since they can be contains any kind of markup. and can be overloaded in different ways. a label must not contain any markup and it is important to use hsc for all data resolved by labels to prevent security impacts. for the type-safe match, I agree, all fine, thx.
  9. Oli Bartsch uploaded patch set 5 09/23/19, 15:59

  10. Oli Bartsch commented on patch set 5 09/23/19, 16:04

    PageLayoutController.php:492 Reply

    All right. I added one hsc after the switch - to not apply them each time inside - and to all other remaining assignments after that.

    PageLayoutController.php:1248 Reply

    Done
  11. TYPO3com voted on patch set 5 V +1 09/23/19, 16:07 Completed build in 08m 34s on Mon, 23 Sep, 04:07 PM Test Summary: 47737 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-36698

  12. Stefan P voted on patch set 5 CR +1 09/24/19, 06:17

  13. Benni Mack commented on patch set 5 09/24/19, 09:01

    PageLayoutController.php:1251

    why "?? true"? if hidden is not there, it defaults to "0" - right?
  14. Oli Bartsch uploaded patch set 6 09/24/19, 09:27

  15. Oli Bartsch commented on patch set 6 09/24/19, 09:30

    PageLayoutController.php:1251 Reply

    Your are totally right. I changed it to "?? false" and added a typecast as hidden is technically an int due to the DBAL.
  16. Frank Nägler commented on patch set 6 09/24/19, 09:38

    PageLayoutController.php:492 Reply

    that is totally fine, thx
  17. TYPO3com voted on patch set 6 V +1 09/24/19, 09:39 Completed build in 11m 53s on Tue, 24 Sep, 09:39 AM Test Summary: 47811 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-36727

  18. Frank Nägler voted on patch set 6 CR +1 09/24/19, 09:41

  19. Frank Nägler voted on patch set 6 V +1 09/24/19, 09:57

  20. Andreas Kienast uploaded patch set 7 09/25/19, 09:18

  21. Andreas Kienast voted on patch set 7 V +1 CR +1 09/25/19, 09:19

  22. Frank Nägler voted on patch set 7 V +2 CR +2 09/25/19, 09:21

  23. TYPO3com voted on patch set 7 V -1 09/25/19, 09:27 Completed build in 08m 47s on Wed, 25 Sep, 09:27 AM Test Summary: 1 of 47819 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-36790

  24. TYPO3com voted on patch set 7 V +1 09/25/19, 09:31 Completed build in 20m 44s on Wed, 25 Sep, 09:31 AM Test Summary: 47720 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-36790

  25. Frank Nägler merged patch set 8 09/25/19, 09:32