Can not insert selected image from Media library in Commerce product

by meez   Last Updated October 19, 2019 11:07 AM

I have Drupal version 8.7.8 and Commerce 8.x-2.14. Can not 'insert selected' image from Media library in Commerce product.

If I create, for test purposes a basis_page content type. Add the field_images (entity reference field) and then in Manage form display set the Widget to Media library, I can insert images without any problem.

But if I try to insert an image from a Commerce Product, I can't insert an image?

I get this error:

Drupal.AjaxError {message: "↵An AJAX HTTP error occurred.↵HTTP Result Code: 50…\Core\DrupalKernel->handle(Object) (Line: 19)↵", name: "AjaxError"} message: "↵An AJAX HTTP error occurred.↵HTTP Result Code: 500↵Debugging information follows.↵Path: http://mysite.nl/product/1185/edit?ajax_form=1↵StatusText: 500 Service unavailable (with message)↵ResponseText: The website encountered an unexpected error. Please try again later.Exception: The current form must not have button-level #validate handlers in Drupal\commerce\Element\CommerceElementTrait::validateElementSubmit() (line 66 of modules/contrib/commerce/src/Element/CommerceElementTrait.php). call_user_func_array(Array, Array) (Line: 282)↵Drupal\Core\Form\FormValidator->doValidateForm(Array, Object) (Line: 238)↵Drupal\Core\Form\FormValidator->doValidateForm(Array, Object) (Line: 238)↵Drupal\Core\Form\FormValidator->doValidateForm(Array, Object) (Line: 238)↵Drupal\Core\Form\FormValidator->doValidateForm(Array, Object, 'commerce_product_simple_product_edit_form') (Line: 118)↵Drupal\Core\Form\FormValidator->validateForm('commerce_product_simple_product_edit_form', Array, Object) (Line: 576)↵Drupal\Core\Form\FormBuilder->processForm('commerce_product_simple_product_edit_form', Array, Object) (Line: 319)↵Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 93)↵Drupal\Core\Controller\FormController->getContentResult(Object, Object)↵call_user_func_array(Array, Array) (Line: 123)↵Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber{closure}() (Line: 582)↵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: 106)↵Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)↵Drupal\page_cache\StackMiddleware\PageCache->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: 693)↵Drupal\Core\DrupalKernel->handle(Object) (Line: 19)↵" name: "AjaxError" proto: Error at http://jb-inflatables.local-dev.shopworks.nl/core/misc/ajax.js?v=8.7.8:98:32 at http://jb-inflatables.local-dev.shopworks.nl/core/misc/ajax.js?v=8.7.8:640:3

Tags : 8 commerce media


Related Questions


Updated August 14, 2016 08:03 AM

Updated April 14, 2017 09:07 AM

Updated August 05, 2017 10:07 AM

Updated August 19, 2015 18:03 PM

Updated September 12, 2019 08:07 AM