Needs work
Project:
Social Auth PayPal
Version:
8.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
13 Jan 2018 at 12:28 UTC
Updated:
23 Jan 2018 at 17:45 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
MaskyS commentedThe problem is due to two factors:
- Paypal does not send back user's email and name if those specific scopes were not requested.
- Despite the actual code adding
email profilescopes as default scopes to the $scopes variable, they were not being requested unless additional scopes were added by site manager in the settings form. The culprit code:Attached below is a patch that fixes this issue.
Comment #3
gvsoThat file needs a lot of refactoring actually. What about doing that here and including these changes?
Comment #4
gvsoCan you please test this patch?
Comment #5
gvsoComment #6
gvsoShould be PayPal. Please change it before committing
Comment #7
MaskyS commentedThe latest patch is not working and is returning an WSOD. I tried clearing the cache, and even uninstalling and re-installing the module. No luck. https://pastebin.com/7N2BwUPD
Comment #8
MaskyS commentedDoes this maybe need further changes due to http://cgit.drupalcode.org/social_auth_paypal/commit/?id=c60028e ?
Comment #9
gvsoSorry. I forgot to update the service declaration.
Comment #10
MaskyS commentedThe website encountered an unexpected error. Please try again later.
Error: Call to a member function get() on null in Drupal\social_auth_paypal\PaypalAuthManager->getScopes() (line 129 of modules/social_auth_paypal/src/PaypalAuthManager.php).
Drupal\social_auth_paypal\PaypalAuthManager->getScopes() (Line: 94)
Drupal\social_auth_paypal\PaypalAuthManager->getPaypalLoginUrl() (Line: 119)
Drupal\social_auth_paypal\Controller\PaypalAuthController->redirectToPaypal()
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 576)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
call_user_func_array(Object, Array) (Line: 153)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 68)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 184)
Drupal\page_cache\StackMiddleware\PageCache->fetch(Object, 1, 1) (Line: 121)
Drupal\page_cache\StackMiddleware\PageCache->lookup(Object, 1, 1) (Line: 75)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 50)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 657)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
Comment #11
gvsoComment #12
gvsoI noticed that there are other changes that should be done to the file
Comment #13
MaskyS commentedI tried appyling the patch in #8 then making the changes in #11, got the following https://pastebin.com/qPu4wPDX error. I guess you were referring to changes that were not included in previous patches?
Comment #14
gvsoI wasn't actually referring to that, but to changes that were introduced to Social Auth Instagram at #2938389: Refactor InstagramAuthManager.
Also, I don't think I'm the most appropriate person to fix this issue since I can't test the changes. Maybe you can work on this, and I can help you and review the code.
Comment #15
MaskyS commentedgotcha. I'll submit a patch soon. Hopefully before the weekend :)