Review main Merged

57657[BUGFIX] Remove flashmessages only from session when session exists

Christoph Lehmann CR +2 V +2 Easy +3 −0 updated 08/05/18, 09:11

Commit message

A user may not be initialized, for example in the BE
module "Extension Configuration".

Review

  • Code review CR +2
    • Anja Leichsenring +2
    • Markus Klein +1
    • Wouter Wolters +1
  • Verified V +2
    • Anja Leichsenring +2
    • Markus Klein +1
    • TYPO3com +1 CI

Issues 1

Files 1

Review log 1517

  1. Christoph Lehmann uploaded patch set 1 07/22/18, 20:30

  2. TYPO3com voted on patch set 1 V +1 07/22/18, 20:37 Completed build in 07m 06s on Sun, 22 Jul, 10:37 PM Test Summary: 33448 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-25657

  3. Markus Klein commented on patch set 1 07/22/18, 20:54

    Does this really only happen in v9?
  4. Christoph Lehmann commented on patch set 1 07/23/18, 09:30

    In 8.7 everything is fine for me. My use case is a userfunc in EM configuration, see https://github.com/christophlehmann/imageoptimizer/blob/master/ext_conf_template.txt#L11 where flashmessages are rendered. See also https://forge.typo3.org/projects/typo3cms-core/repository/revisions/aed46d2af8a98e1c6fffb3d5ee170a33ecc0a9f0/diff/typo3/sysext/core/Classes/Messaging/FlashMessageQueue.php The check for a valid user in getFlashMessagesFromSession() is new, but was not realized how i did it now
  5. Markus Klein commented on patch set 1 07/23/18, 12:06

    Alright. Can you please debug what $user really is in this case?
  6. Markus Klein commented on patch set 1 07/23/18, 12:07

    Sorry, no. I still don't get why this is working in v8.
  7. Christoph Lehmann commented on patch set 1 07/23/18, 12:40

    It's because \TYPO3\CMS\Core\Messaging\FlashMessageQueue::getUserByContext() returns a user in v8
  8. Markus Klein commented on patch set 1 07/23/18, 13:49

    The code of getUserByContext() has last been changed before 2012 somewhen, so this function works exactly the same in v8
  9. Christoph Lehmann commented on patch set 1 07/23/18, 16:35

    The point is (correct engl?!) that there no user is initialized and FlashMessageQueue::getUserByContext() returns null. You can check it like this: 1. Install https://github.com/christophlehmann/imageoptimizer/tree/typo3-9-0 2. Go to Settings Module 3. Click on Extension Configuration
  10. Markus Klein commented on patch set 1 07/23/18, 21:43

    Ah now I got your point. Not the function has been changed, but the environment: No user there.
  11. Markus Klein commented on patch set 1 07/23/18, 21:44

    FlashMessageQueue.php:139

    can we add the check inside removeAllFlashMessagesFromSession?
  12. Christoph Lehmann uploaded patch set 2 07/24/18, 07:26

  13. TYPO3com voted on patch set 2 V +1 07/24/18, 07:32 Completed build in 06m 06s on Tue, 24 Jul, 09:32 AM Test Summary: 33448 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-25706

  14. Markus Klein commented on patch set 2 V +1 CR +1 07/24/18, 07:39

    look very good to me now. Thanks.
  15. Wouter Wolters voted on patch set 2 CR +1 07/24/18, 08:09

  16. Anja Leichsenring voted on patch set 2 V +2 CR +2 08/05/18, 09:11

  17. Anja Leichsenring merged patch set 3 08/05/18, 09:11