Review main Merged

63318[BUGFIX] Render exception for backend preview as error

Daniel Siepmann CR +2 V +2 Easy +12 −0 updated 02/23/20, 19:51

Commit message

Prior only an warning was logged, and a fallback rendering jumped in.
With this change an error is rendered in addition to logging. No
fallback will be triggered anymore.

This should raise awareness and ease integration for integrators.
Please note that already broken elements might now show an error
instead of fallback preview.

This is only activated for admin users and enabled BE|debug system
setting.

Review

  • Code review CR +2 Done
    • Georg Ringer +2
    • Oli Bartsch +1
    • Björn Jacob +1
    • Ingo Fabbri +1
    • Christian Eßl +1
    • Susi Moog +1
  • Verified V +2 Done
    • Georg Ringer +2
    • Christian Eßl +1
    • TYPO3com +1 CI

Issues 1

Files 1

Review log 4557

Show 2332 earlier messages
  1. Daniel Siepmann uploaded patch set 1 02/19/20, 07:33

  2. TYPO3com voted on patch set 1 V -1 02/19/20, 07:33 Completed build in 23s on Wed, 19 Feb, 07:33 AM Test Summary: No tests found Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-287

  3. Georg Ringer commented on patch set 1 V -1 CR -1 02/19/20, 07:41

    1st this needs a rst but I would turn that into a bugfix and backport it to 9.5 as well. regarding implementation: instead of a flash message I would render that below the actual content because if there are multiple content elements it would be very hard to know wich one triggered it
  4. Daniel Siepmann uploaded patch set 2 02/19/20, 07:44

  5. Daniel Siepmann commented on patch set 2 02/19/20, 07:49

    > Patch Set 1: Verified-1 Code-Review-1 > > 1st this needs a rst but I would turn that into a bugfix and backport it to 9.5 as well. > regarding implementation: instead of a flash message I would render that below the actual content because if there are multiple content elements it would be very hard to know wich one triggered it The FlashMessage is rendered within the Preview of each content element. I just use the API to generate the proper HTML for styling. RST is added already. If bugfix or task is okay, I'm fine and will adjust ;)
  6. TYPO3com voted on patch set 2 V -1 02/19/20, 07:57 Completed build in 12m 51s on Wed, 19 Feb, 07:57 AM Test Summary: 4 of 71799 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-288

  7. Daniel Siepmann uploaded patch set 3 02/19/20, 08:06

  8. TYPO3com voted on patch set 2 V +1 02/19/20, 08:12 Completed build in 13m 14s on Wed, 19 Feb, 08:12 AM Test Summary: 71344 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-289

  9. TYPO3com voted on patch set 3 V +1 02/19/20, 08:21 Completed build in 15m 05s on Wed, 19 Feb, 08:21 AM Test Summary: 71344 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-290

  10. Christian Eßl commented on patch set 3 02/19/20, 08:25

    PageLayoutView.php:1251

    $out has never been defined and is not used after that. Looks useless to me?
  11. Claus Due commented on patch set 3 02/19/20, 08:45

    PageLayoutView.php:1250

    I would actually say don't check debug mode at all, regardless of debug being on, the flash message is still a better feedback than suppressing output.

    PageLayoutView.php:1251 Reply

    ACK, the method can return the flash message HTML directly when this case is reached.
  12. Daniel Siepmann marked it work in progress 02/19/20, 09:00

  13. Daniel Siepmann uploaded patch set 4 02/19/20, 09:09

  14. Daniel Siepmann commented on patch set 4 02/19/20, 09:09

    This change is ready for review.
  15. Daniel Siepmann commented on patch set 4 02/19/20, 09:11

    PageLayoutView.php:1250 Reply

    Done, it will no longer check for debugging, but just display the warning instead.

    PageLayoutView.php:1251 Reply

    Sorry, worked on older version of the class. Is fixed now. Adjusted, the method now returns the content. Therefore no fallback will jump in anymore.
  16. TYPO3com voted on patch set 4 V +1 02/19/20, 09:23 Completed build in 13m 28s on Wed, 19 Feb, 09:23 AM Test Summary: 71344 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-292

  17. Helmut Hummel commented on patch set 4 02/19/20, 09:40

    Makes sense to show a message for the user in this case. Two comments about the implementation: It is imho a misuse of flash message API. The warning isn’t a flash message (which are messages always shown on a central place, not inline) Reusing the warning message that is being logged leads to a information disclosure (full server path is shown to users)
  18. Daniel Siepmann commented on patch set 4 02/19/20, 11:09

    > Patch Set 4: > > Makes sense to show a message for the user in this case. > > Two comments about the implementation: > It is imho a misuse of flash message API. > The warning isn’t a flash message (which are messages always shown on a central place, not inline) > > Reusing the warning message that is being logged leads to a information disclosure (full server path is shown to users) Thanks, I could adjust the message. I'm aware that this is a misuse. I'm not aware of an way to generate the HTML through another API and don't want to build HTML myself here. So that was a trade off I used. Is there a better approach instead of using the API for FlashMessages?
  19. Daniel Siepmann uploaded patch set 5 02/19/20, 11:15

  20. TYPO3com voted on patch set 5 V +1 02/19/20, 11:29 Completed build in 13m 01s on Wed, 19 Feb, 11:28 AM Test Summary: 71342 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-294

  21. Daniel Siepmann uploaded patch set 6 02/19/20, 11:52

  22. Daniel Siepmann commented on patch set 6 02/19/20, 11:53

    > Patch Set 4: > > Makes sense to show a message for the user in this case. > > Two comments about the implementation: > It is imho a misuse of flash message API. > The warning isn’t a flash message (which are messages always shown on a central place, not inline) > > Reusing the warning message that is being logged leads to a information disclosure (full server path is shown to users) No more misuse, talked with Benji and use infobox ViewHelper instead 👍.
  23. Daniel Siepmann uploaded patch set 7 02/19/20, 12:00

  24. TYPO3com voted on patch set 6 V +1 02/19/20, 12:07 Completed build in 14m 11s on Wed, 19 Feb, 12:07 PM Test Summary: 71344 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-295

  25. Daniel Siepmann updated the commit message in patch set 8 02/19/20, 12:14

  26. TYPO3com voted on patch set 7 V +1 02/19/20, 12:14 Completed build in 13m 47s on Wed, 19 Feb, 12:14 PM Test Summary: 71341 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-296

  27. TYPO3com voted on patch set 8 V +1 02/19/20, 12:28 Completed build in 12m 52s on Wed, 19 Feb, 12:27 PM Test Summary: 71344 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-297

  28. Sebastian Fischer voted on patch set 8 CR +1 02/19/20, 12:59

  29. Torben Hansen voted on patch set 8 CR +1 02/19/20, 14:27

  30. Georg Ringer voted on patch set 8 V +1 CR +1 02/19/20, 14:44

  31. Helmut Hummel commented on patch set 8 02/19/20, 15:07

    Thanks. Looks much better now already. I still think a UI error message deserves a little more love than showing the exception error message. E.g. it would make sense to have it translatable. otoh it is better to show it rather than hiding it (untranslated) in the logs and target group is devs anyway.
  32. Christian Eßl voted on patch set 8 V +1 CR +1 02/19/20, 17:55

  1. Daniel Goerz commented on patch set 8 02/22/20, 21:41

    Not sure about the backports as this could change the output of the page module, right?
  2. Ingo Fabbri commented on patch set 8 CR +1 02/22/20, 23:24

    PageLayoutView.php:1250 Reply

    Actually liked the check for debug enabled. Maybe check for isAdmin instead? I can't find any use-case where a regular user should see this warning.
  3. Susi Moog commented on patch set 8 CR -1 02/23/20, 11:02

    please don't do this for 9.5 and 8.7 - it changes the behaviour of the page module, resulting in unusable pages if there are rendering problems in released versions!
  4. Susi Moog commented on patch set 8 02/23/20, 11:03

    ... wanted to block before merge, will test changed behaviour now and weigh options.
  5. Claus Due commented on patch set 8 02/23/20, 11:14

    > ... wanted to block before merge, will test changed behaviour now and weigh options. No problem Susi. I've finished my testing and would have thrown +2/+2. The main difference is that instead of seeing no warnings anywhere, you see an infobox where the preview would be, which states a semi-anonymized (no template paths) warning about errors in the Fluid template. IMHO this would be acceptable down to 8.7 but I await your feedback.
  6. Claus Due commented on patch set 8 02/23/20, 11:15

    "no template paths" meaning "not an absolute path, site-root relative path *is* shown.
  7. Ingo Fabbri commented on patch set 8 02/23/20, 11:20

    > Patch Set 8: > > > ... wanted to block before merge, will test changed behaviour now and weigh options. > > No problem Susi. I've finished my testing and would have thrown +2/+2. The main difference is that instead of seeing no warnings anywhere, you see an infobox where the preview would be, which states a semi-anonymized (no template paths) warning about errors in the Fluid template. IMHO this would be acceptable down to 8.7 but I await your feedback. lol and yes. these concerns would speak for BE-debug check. People running production in BE-debug=1 should blame themeselves. Anyhow it does not break anything - just outputs the infobox. but still regular editors could be scared. Thats why I - preferred - opted for isAdmin-check or at least use the BE-debug check (as Daniel initially already had in his patch). Just my 2c
  8. Daniel Siepmann commented on patch set 8 02/23/20, 11:22

    > Patch Set 8: > > > Patch Set 8: > > > > > ... wanted to block before merge, will test changed behaviour now and weigh options. > > > > No problem Susi. I've finished my testing and would have thrown +2/+2. The main difference is that instead of seeing no warnings anywhere, you see an infobox where the preview would be, which states a semi-anonymized (no template paths) warning about errors in the Fluid template. IMHO this would be acceptable down to 8.7 but I await your feedback. > > lol and yes. these concerns would speak for BE-debug check. People running production in BE-debug=1 should blame themeselves. Anyhow it does not break anything - just outputs the infobox. but still regular editors could be scared. Thats why I - preferred - opted for isAdmin-check or at least use the BE-debug check (as Daniel initially already had in his patch). Just my 2c Yeah, also the current process is to fallback to default TYPO3 preview. That would also change. Right now that one would be replaced, no preview, only an error infobox. I would be ok with either adding it on top of the fallback preview, as well as using BE|debug=1.
  9. Susi Moog commented on patch set 8 02/23/20, 11:25

    ok, after testing: - the exception message itself for some reason always only contains an empty string instead of the template path in my case (The Fluid template files "" could not be loaded.) --> may be a different root cause - while it does not make the page unusable, it's not editor relevant information, so the editor really should get the fallback behaviour from before - even for admins the view should not change in released versions - as it is not completely silent but logged I don't see it as important change to have that in old TYPO3 versions Summary of my opinion: - master only - admin only
  10. Björn Jacob commented on patch set 8 02/23/20, 11:37

    Sry, nitpicks, I know. But if you have to work on it again..
    "an"
    "an"
  11. Daniel Siepmann uploaded patch set 9 02/23/20, 14:12

  12. Daniel Siepmann updated the commit message in patch set 10 02/23/20, 14:13

  13. Daniel Siepmann commented on patch set 10 02/23/20, 14:14

    > Patch Set 8: > > ok, after testing: > > - the exception message itself for some reason always only contains an empty string instead of the template path in my case (The Fluid template files "" could not be loaded.) --> may be a different root cause > - while it does not make the page unusable, it's not editor relevant information, so the editor really should get the fallback behaviour from before > - even for admins the view should not change in released versions - as it is not completely silent but logged I don't see it as important change to have that in old TYPO3 versions > > Summary of my opinion: > - master only > - admin only admin + debug on only And master only. Would be nice to know under which circumstances the file name is gone.

    Reply

    Done

    Reply

    Done

    Reply

    We will only patch current master.
  14. Daniel Siepmann commented on patch set 10 02/23/20, 14:15

    PageLayoutView.php:1250 Reply

    Done

    PageLayoutView.php:1251 Reply

    Done
  15. Daniel Siepmann updated the commit message in patch set 11 02/23/20, 14:23

  16. TYPO3com voted on patch set 9 V +1 02/23/20, 14:37 Completed build in 22m 07s on Sun, 23 Feb, 02:37 PM Test Summary: 71585 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-559

  17. Susi Moog voted on patch set 11 CR +1 02/23/20, 14:40

  18. TYPO3com voted on patch set 10 V +1 02/23/20, 14:43 Completed build in 28m 24s on Sun, 23 Feb, 02:43 PM Test Summary: 71586 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-560

  19. Björn Jacob commented on patch set 11 CR +1 02/23/20, 14:48

    Thanks for taking care.
  20. TYPO3com voted on patch set 11 V +1 02/23/20, 14:50 Completed build in 15m 58s on Sun, 23 Feb, 02:50 PM Test Summary: 71586 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-561

  21. Oli Bartsch voted on patch set 11 CR +1 02/23/20, 15:55

  22. Christian Eßl voted on patch set 11 V +1 CR +1 02/23/20, 17:08

  23. Ingo Fabbri voted on patch set 11 CR +1 02/23/20, 19:23

  24. Georg Ringer voted on patch set 11 V +2 CR +2 02/23/20, 19:51

  25. Georg Ringer merged patch set 12 02/23/20, 19:51