Problem

When saving an SF auth provider's settings (and going through the auth token retrieval process) the following notice appears:

Notice: Undefined property: Drupal\salesforce_jwt\Plugin\SalesforceAuthProvider\SalesforceJWTPlugin::$credentials in Drupal\salesforce\SalesforceAuthProviderPluginBase->getCredentials() (line 194 of modules/contrib/salesforce/src/SalesforceAuthProviderPluginBase.php).

Drupal\salesforce\SalesforceAuthProviderPluginBase->getCredentials() (Line: 197)
Drupal\salesforce_jwt\Plugin\SalesforceAuthProvider\SalesforceJWTPlugin->generateAssertion() (Line: 152)
Drupal\salesforce_jwt\Plugin\SalesforceAuthProvider\SalesforceJWTPlugin->validateConfigurationForm(Array, Object) (Line: 133)
Drupal\salesforce\Form\SalesforceAuthForm->validateForm(Array, Object)
call_user_func_array(Array, Array) (Line: 82)
Drupal\Core\Form\FormValidator->executeValidateHandlers(Array, Object) (Line: 273)
Drupal\Core\Form\FormValidator->doValidateForm(Array, Object, 'salesforce_auth_form') (Line: 118)
Drupal\Core\Form\FormValidator->validateForm('salesforce_auth_form', Array, Object) (Line: 589)
Drupal\Core\Form\FormBuilder->processForm('salesforce_auth_form', Array, Object) (Line: 321)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 91)
Drupal\Core\Controller\FormController->getContentResult(Object, Object) (Line: 39)
Drupal\layout_builder\Controller\LayoutBuilderHtmlEntityFormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 573)
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}() (Line: 151)
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: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 52)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 708)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

This notice appears regardless of the authorization working or not.

Steps to reproduce

* Install Salesforce and Salesforce JWT modules (and relevant dependencies)
* Add JWT key
* Add JWT auth providers using JWT key
* Error will appear on provider settings save on provider listing page

Proposed resolution

Fix the code to remove the notcie.

CommentFileSizeAuthor
#2 salesforce-php-notice.patch689 bytesaaronbauman

Comments

ironsizide created an issue. See original summary.

aaronbauman’s picture

Status: Active » Needs review
StatusFileSize
new689 bytes

  • AaronBauman committed 5e2a2d4 on 8.x-4.x
    Issue #3172772 by AaronBauman: PHP Notice for undefined property during...
aaronbauman’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.