Error when administrator modifies an existing store :
Type php
Date Jeudi, 9 janvier, 2020 - 14:40
Utilisateur administrateur
Emplacement https://www.example.com/fr/store/19/edit?destination=%2Ffr%2Fadmin%2Fcommerce%2Fconfig%2Fstores
Référent https://www.example.com/
Message Error: Call to a member function id() on null in Drupal\commerce_marketplace\Form\MarketplaceForm->save() (line 83 of /var/www/www-example-com/web/modules/contrib/commerce_marketplace/src/Form/MarketplaceForm.php) #0 [internal function]: Drupal\commerce_marketplace\Form\MarketplaceForm->save(Array, Object(Drupal\Core\Form\FormState)) #1 /var/www/www-example-com/web/core/lib/Drupal/Core/Form/FormSubmitter.php(112): call_user_func_array(Array, Array) #2 /var/www/www-example-com/web/core/lib/Drupal/Core/Form/FormSubmitter.php(52): Drupal\Core\Form\FormSubmitter->executeSubmitHandlers(Array, Object(Drupal\Core\Form\FormState)) #3 /var/www/www-example-com/web/core/lib/Drupal/Core/Form/FormBuilder.php(591): Drupal\Core\Form\FormSubmitter->doSubmitForm(Array, Object(Drupal\Core\Form\FormState)) #4 /var/www/www-example-com/web/core/lib/Drupal/Core/Form/FormBuilder.php(320): Drupal\Core\Form\FormBuilder->processForm('commerce_store_...', Array, Object(Drupal\Core\Form\FormState)) #5 /var/www/www-example-com/web/core/lib/Drupal/Core/Controller/FormController.php(91): Drupal\Core\Form\FormBuilder->buildForm(Object(Drupal\commerce_marketplace\Form\MarketplaceForm), Object(Drupal\Core\Form\FormState)) #6 [internal function]: Drupal\Core\Controller\FormController->getContentResult(Object(Symfony\Component\HttpFoundation\Request), Object(Drupal\Core\Routing\RouteMatch)) #7 /var/www/www-example-com/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array(Array, Array) #8 /var/www/www-example-com/web/core/lib/Drupal/Core/Render/Renderer.php(573): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() #9 /var/www/www-example-com/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure)) #10 /var/www/www-example-com/web/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) #11 /var/www/www-example-com/vendor/symfony/http-kernel/HttpKernel.php(151): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() #12 /var/www/www-example-com/vendor/symfony/http-kernel/HttpKernel.php(68): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1) #13 /var/www/www-example-com/web/core/lib/Drupal/Core/StackMiddleware/Session.php(57): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #14 /var/www/www-example-com/web/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(47): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #15 /var/www/www-example-com/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #16 /var/www/www-example-com/web/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, true) #17 /var/www/www-example-com/web/core/modules/ban/src/BanMiddleware.php(50): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #18 /var/www/www-example-com/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(47): Drupal\ban\BanMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #19 /var/www/www-example-com/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(52): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #20 /var/www/www-example-com/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #21 /var/www/www-example-com/web/core/lib/Drupal/Core/DrupalKernel.php(694): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #22 /var/www/www-example-com/web/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request)) #23 {main}.
Severity Erreur| Comment | File | Size | Author |
|---|---|---|---|
| #7 | 3105360-7.patch | 1.97 KB | drugan |
| #4 | store-saved.png | 130.38 KB | drugan |
| #4 | owner-field-enabled.png | 119.29 KB | drugan |
Comments
Comment #2
drugan commentedThe solution for this issue will be provided a bit later.
In the meantime please, keep the Owner field on a store type form display enabled.
Comment #3
zenimagine commentedI just activated the owner field on the form but I still receive the same error when I modify a store
Comment #4
drugan commentedI have Drupal 8.8.0 and Drupal Commerce latest dev installed and have no issues when saving a store. See screenshots.
Which versions do you use?
Comment #5
zenimagine commented@drugan Drupal 8.8.1 and Commerce 2.16, here is the content of composer.json :
Comment #6
drugan commentedSmells something like the https://www.drupal.org/project/group is a culprit. I remember a couple of issues on the Drupal Commerce were related with this module.
So, in this case please wait a bit until any contrib module agnostic solution will be found for this issue.
Comment #7
drugan commentedLet's test it.
Comment #8
zenimagine commented@drugan Great, thank you the patch works
Comment #10
drugan commented