Steps to reproduce this issue:
1. Install `Commerce Payment Example` module.
2. Use `Example (Off-site redirect)` as Payment gateway.
3. Checkout the product and on `Order information` page click on `Continue to review` button.
Here you will see following error:
The website encountered an unexpected error. Please try again later.Drupal\Component\Plugin\Exception\PluginNotFoundException: The "entity:profile:customer" plugin does not exist. in Drupal\Core\Plugin\DefaultPluginManager->doGetDefinition() (line 52 of core/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php). Drupal\Core\Plugin\DefaultPluginManager->getDefinition('entity:profile:customer') (Line: 288)
Drupal\Core\TypedData\TypedDataManager->getCanonicalRepresentation(Object) (Line: 132)
Drupal\Core\TypedData\Validation\RecursiveContextualValidator->validateNode(Object, NULL, 1) (Line: 99)
Drupal\Core\TypedData\Validation\RecursiveContextualValidator->validate(Object, NULL, NULL) (Line: 90)
Drupal\Core\TypedData\Validation\RecursiveValidator->validate(Object) (Line: 135)
Drupal\Core\TypedData\TypedData->validate() (Line: 411)
Drupal\Core\Entity\ContentEntityBase->validate() (Line: 233)
Drupal\Core\Entity\Entity\EntityFormDisplay->validateFormValues(Object, Array, Object) (Line: 130)
Drupal\commerce_order\Element\ProfileSelect::validateForm(Array, Object, Array)
call_user_func_array(Array, Array) (Line: 281)
Drupal\Core\Form\FormValidator->doValidateForm(Array, Object) (Line: 239)
Drupal\Core\Form\FormValidator->doValidateForm(Array, Object) (Line: 239)
Drupal\Core\Form\FormValidator->doValidateForm(Array, Object, 'commerce_checkout_flow_multistep_default') (Line: 119)
Drupal\Core\Form\FormValidator->validateForm('commerce_checkout_flow_multistep_default', Array, Object) (Line: 571)
Drupal\Core\Form\FormBuilder->processForm('commerce_checkout_flow_multistep_default', Array, Object) (Line: 314)
Drupal\Core\Form\FormBuilder->buildForm('commerce_checkout_flow_multistep_default', Object) (Line: 212)
Drupal\Core\Form\FormBuilder->getForm(Object, 'order_information') (Line: 93)
Drupal\commerce_checkout\Controller\CheckoutController->formPage(Object)
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: 67)
Drupal\simple_oauth\HttpMiddleware\BasicAuthSwap->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: 99)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 78)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 40)
Drupal\jsonapi\StackMiddleware\FormatSetter->handle(Object, 1, 1) (Line: 84)
Drupal\shield\ShieldMiddleware->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)
Comments
Comment #2
adhariwal commentedAfter doing some initial investigations I found on line number 209 of the class Drupal\Core\Form\FormBuilder
the first index of the `$args` array is unset to remove the argument passed to the metod `getForm`. But in case of Druapl checkout flow the value of the first index of `$args` is an instance of `MultistepDefault` plugin which actully get unset hence above error is thrown.
Comment #3
bojanz commentedWhat is your Drupal core version? I've never seen this error before, something must have changed somewhere.
Comment #4
adhariwal commented@bojanz it is `8.4.5 `
Comment #5
renat commentedadhariwal, can you, please, provide a list of exact steps to reproduce this issue on a site installed with:
composer create-project drupalcommerce/project-base mystore --stability dev
In my case, `Continue to review` button works just fine with `Example (Off-site redirect)` Payment gateway, even though I've tested different gateway options. Drupal 8.4.5, Drupal Commerce 8.x-2.4, PHP built-in server, PHP7.1 or PHP7.0.
Comment #6
bojanz commentedThis is one of those bugs that are extremely hard to reproduce, and indicate a system in a temporarily broken state.
The person who reproduces it will have to come up with a patch, if one is possible.
Comment #7
jmester13 commented@bojanz @adhariwal @renat I'm currently running into this error and it's my very first commerce install do I get a prize?
I do not have Commerce Payment Example installed. I am trying to use Square Connect and have this small "patch" in the works currently, https://www.drupal.org/project/commerce_square/issues/3159268
Drupal 8.9.16
Commerce 2.24
PHP 7.3.28
My hosting is with Pantheon and I'm currently on a dev site that I'm trying to get working to production. Happy to share code access and jump on a call with someone. Appreciate any help you can offer here as I'm relatively new the Drupal development and am more experience with front end dev.
Thanks all.
Comment #8
jmester13 commentedAll,
I found a resolution to this error after also creating a reddit post.
The long and short of it is that something got wonky during the install process, probably a memory issue, that didn't allow all the install yml files to be loaded. Below is the process I went through to resolve this matter.
Check for missing config files by comparing what you can export to what is actually in your code base (modules/commerce/modules/NAME/install/)
Order > Install was missing a bunch of yml files. But I was unable to import them because of this error message
“Configuration core.entity_form_display.profile.customer.default depends on configuration (field.field.profile.customer.address, profile.type.customer) that will not exist after import. Import a single configuration item by pasting its YAML structure into the text field.”
In order to get around this, I removed these fields from the config file core.entity_form_display.profile.customer.default.yml , specified the UUID(get it from the export option) and imported over it.
Then I was able to import the rest of the missing yml files. Some had to be installed before another so you might have to jump around a bit.
Once the remaining yml are imported you can add the fields back to core.entity_form_display.profile.customer.default.yml and reimport it with the UUID again.