Whilst registering or logging in through Twitter the following 2 Exceptions are thrown and show up in the Watchdog log.
The registration/logging in still works as expected.
LogicException: The controller result claims to be providing relevant cache metadata, but leaked metadata was detected. Please ensure you are not rendering content too early. Returned object class: Drupal\Core\Routing\TrustedRedirectResponse. in Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() (line 154 of /.../docroot/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php).
RuntimeException: Failed to start the session because headers have already been sent by "/.../vendor/symfony/http-foundation/Response.php" at line 1286. in Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage->start() (line 141 of /.../vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php) #0 /.../docroot/core/lib/Drupal/Core/Session/SessionManager.php(164): Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage->start() #1 /.../docroot/core/lib/Drupal/Core/Session/SessionManager.php(195): Drupal\Core\Session\SessionManager->startNow() #2 /.../vendor/symfony/http-foundation/Session/Session.php(196): Drupal\Core\Session\SessionManager->save() #3 /.../docroot/core/lib/Drupal/Core/StackMiddleware/Session.php(60): Symfony\Component\HttpFoundation\Session\Session->save() #4 /.../docroot/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(47): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #5 /.../docroot/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #6 /.../docroot/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true) #7 /.../docroot/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(47): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #8 /.../docroot/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(52): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #9 /.../vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #10 /.../docroot/core/lib/Drupal/Core/DrupalKernel.php(693): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #11 /.../docroot/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request)) #12 {main}.
Severity Error| Comment | File | Size | Author |
|---|---|---|---|
| #12 | 3068326-12.patch | 6.78 KB | rajab natshah |
| #7 | 3068326-Watchdog_with_patch.png | 27.03 KB | spokje |
| #7 | 3068326-Watchdog_without_patch.png | 48.97 KB | spokje |
| #5 | 3068326-5.patch | 6.52 KB | spokje |
Comments
Comment #2
itaran commentedgot the similar issue, this patch works for me
Comment #3
itaran commentedComment #4
avpadernoComment #5
spokjeRe-rolled patch #2 against latest Dev branch (the path of the files was incorrect, otherwise no code changes were made)
Comment #6
spokjeTitle/Summary update
Comment #7
spokjeI've tested patch #6.
I know I uploaded it myself, but it a re-roll of #2 with only the paths of the file to be patched corrected. No code changes were made between #6 and #2.
Screenshot (3068326-Watchdog_without_patch) shows the watchdog log on a site without patch #6 applied whilst:
(1) Registering a new user through Twitter
(2) Logging in with that new user through Twitter
The 2 Exceptions mentioned in the description of this issue are present.
Screenshot (3068326-Watchdog_with_patch) shows the watchdog log on a site with patch #6 applied whilst:
(1) Registering a new user through Twitter
(2) Logging in with that new user through Twitter
The 2 Exceptions mentioned in the description of this issue are gone. Logging in and registering through Twitter works as expected.
Marking as RTBC
Note: The
Notice: Undefined property: stdClass::$emailis fixed in this separate issue and should be ignored in this issue.Comment #8
avpadernoThe user who provided the patch shouldn't change the status to Reviewed & tested by the community. That is something a different user should do.
Comment #9
spokje@kiamlaluno I totally agree, but does this also apply when doing a simple re-roll of a patch created by another user?
As stated above: I didn't make any code changes, patch #2 doesn't apply because the path of the file-to-patch is incorrect (
docroot/modules/contrib/social_auth_twitter/src/Controller/TwitterAuthController.php). I simply changed that to the correct path (a/src/Controller/TwitterAuthController.php) in my patch #6.Since it's a reroll I couldn't add an interdiff, but that's the only change I've made.
Comment #10
spokjeOops, didn't mean to change the status back to RTBC, had an old browser window open...
Setting back to NR
Comment #11
rajab natshahComment #12
rajab natshahA new patch only to cover #3201021: Fix Fatal Error when the Twitter social button clicked on, or When the login page redirects to "user/login/twitter"
On top of this issue
Comment #13
rajab natshahComment #15
Abdullah Yassin commentedComment #16
Abdullah Yassin commented