Review main Merged

64441[BUGFIX] Ensure UserAspect->isLoggedIn() checks for user only

Benni Mack CR +2 V +2 Easy +13 −11 updated 10/12/20, 00:01

Commit message

isLoggedIn() is referring to the user, as Frontend sometimes needs
"isUserOrGroupSet()" functionality for working with Admin Panel Previews
or the infamous pages.fe_login_mode where the user log in is hidden but
the group is still valid.

Review

  • Code review CR +2 Done
    • Daniel Goerz +2
    • Oliver Klee +1
    • Alexander Schnitzler +1
    • Simon Schaufelberger +1
  • Verified V +2 Done
    • Daniel Goerz +2
    • Alexander Schnitzler +1
    • TYPO3com +1 CI

Issues 1

Files 3

Review log 1823

  1. Benni Mack uploaded patch set 1 05/09/20, 09:18

  2. TYPO3com voted on patch set 1 V -1 05/09/20, 09:34 Completed build in 16m 13s on Sat, 9 May, 09:34 AM Test Summary: 2419 of 11840 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-3280

  3. Benni Mack uploaded patch set 2 05/10/20, 17:45

  4. TYPO3com voted on patch set 2 V -1 05/10/20, 17:57 Completed build in 11m 17s on Sun, 10 May, 05:57 PM Test Summary: 12 of 74180 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-3292

  5. Susi Moog commented on patch set 2 05/11/20, 07:30

    Tests are failing as they expect the user login to fail if no groups are assigned to a user
  6. Benni Mack updated the commit message in patch set 3 05/25/20, 18:50

  7. Benni Mack abandoned the change 08/10/20, 12:37

    should work already in typo3 v9/v10
  8. Simon Schaufelberger commented on patch set 3 08/13/20, 21:41

    I have a middleware that hooks in after the FrontendUserAuthenticator. I expect to have an authenticated user at this point but when I call GeneralUtility::makeInstance(Context::class)->getAspect('frontend.user')->isLoggedIn() I get FALSE. The problem is that the USER record is loaded at this point but NOT his groups! How can I load the user groups manually? PS: the user groups get loaded only in TypoScriptFrontendController->fetch_the_id which by the way has nothing to do with the authenticated user Shouldn't it be enough to just check for a loaded user id instead of also the groups (in the method isLoggedIn)?
  9. Benni Mack restored the change 10/09/20, 07:25

  10. Benni Mack rebased onto patch set 4 10/09/20, 07:25

  11. TYPO3com voted on patch set 4 V -1 10/09/20, 07:39 Completed build in 13m 08s on Fri, 9 Oct, 07:39 AM Test Summary: 12 of 74249 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-6388

  12. Benni Mack uploaded patch set 5 10/09/20, 08:47

  13. TYPO3com voted on patch set 5 V -1 10/09/20, 09:03 Completed build in 16m 23s on Fri, 9 Oct, 09:03 AM Test Summary: 12 of 74249 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-6390

  14. Benni Mack uploaded patch set 6 10/09/20, 10:01

  15. TYPO3com voted on patch set 6 V +1 10/09/20, 10:15 Completed build in 13m 49s on Fri, 9 Oct, 10:15 AM Test Summary: 73764 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-6393

  16. Oliver Klee voted on patch set 6 CR +1 10/09/20, 11:08

  17. Simon Schaufelberger voted on patch set 6 CR +1 10/09/20, 13:26

  18. Alexander Schnitzler voted on patch set 6 V +1 CR +1 10/10/20, 06:20

  19. Daniel Goerz commented on patch set 6 10/10/20, 08:01

    UserAspect.php:102 Unresolved

    I fail to parse this sentence :)

    UserAspect.php:110

    Isn't this quite a breaking change?
  20. Benni Mack commented on patch set 6 10/10/20, 08:07

    UserAspect.php:110 Reply

    As you see: We need to adapt the tests, they were testing wrong behavior. Because "it was implemented the wrong way" (by myself, when introducing the Context API and trying to understand the behaviour). So, yes it is a breaking change, but it was wrong before. Fixing means: Breaking the broken behavior? :D I'm fine either way, we could fix it down till v9, but I feel v10 is suited better currently. Master-only would work as well. I think there are at least 3 issues in forge addressing this problem of the existing BROKEN behaviour ;).
  21. Daniel Goerz commented on patch set 6 V +2 CR +2 10/10/20, 14:00

    UserAspect.php:110 Reply Unresolved

    Well, alright then :)
  22. Daniel Goerz merged patch set 7 10/10/20, 14:01

  23. Simon Schaufelberger commented on patch set 7 10/12/20, 00:01

    Thank you for this fix!