If the display label is not entered on the payment gateway configuration form, the customer will get a WSOD error during checkout.

The website encountered an unexpected error. Please try again later.</br></br><em class="placeholder">InvalidArgumentException</em>: Missing required property &quot;label&quot;. in <em class="placeholder">Drupal\commerce_payment\PaymentOption-&gt;__construct()</em> (line <em class="placeholder">56</em> of <em class="placeholder">modules/contrib/commerce/modules/payment/src/PaymentOption.php</em>). <pre class="backtrace">Drupal\commerce_payment\PaymentOptionsBuilder-&gt;buildOptions(Object, Array) (Line: 172)
Drupal\commerce_payment\Plugin\Commerce\CheckoutPane\PaymentInformation-&gt;buildPaneForm(Array, Object, Array) (Line: 558)
Drupal\commerce_checkout\Plugin\Commerce\CheckoutFlow\CheckoutFlowWithPanesBase-&gt;buildForm(Array, Object, &#039;order_information&#039;)
call_user_func_array(Array, Array) (Line: 518)
Drupal\Core\Form\FormBuilder-&gt;retrieveForm(&#039;commerce_checkout_flow_multistep_default&#039;, Object) (Line: 275)
Drupal\Core\Form\FormBuilder-&gt;buildForm(&#039;commerce_checkout_flow_multistep_default&#039;, Object) (Line: 216)
Drupal\Core\Form\FormBuilder-&gt;getForm(Object, &#039;order_information&#039;) (Line: 94)
Drupal\commerce_checkout\Controller\CheckoutController-&gt;formPage(Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber-&gt;Drupal\Core\EventSubscriber\{closure}() (Line: 582)
Drupal\Core\Render\Renderer-&gt;executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber-&gt;wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber-&gt;Drupal\Core\EventSubscriber\{closure}() (Line: 151)
Symfony\Component\HttpKernel\HttpKernel-&gt;handleRaw(Object, 1) (Line: 68)
Symfony\Component\HttpKernel\HttpKernel-&gt;handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session-&gt;handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle-&gt;handle(Object, 1, 1) (Line: 99)
Drupal\page_cache\StackMiddleware\PageCache-&gt;pass(Object, 1, 1) (Line: 78)
Drupal\page_cache\StackMiddleware\PageCache-&gt;handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware-&gt;handle(Object, 1, 1) (Line: 52)
Drupal\Core\StackMiddleware\NegotiationMiddleware-&gt;handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel-&gt;handle(Object, 1, 1) (Line: 693)
Drupal\Core\DrupalKernel-&gt;handle(Object) (Line: 19)
</pre>
CommentFileSizeAuthor
#2 3041456-2.patch702 byteslisastreeter

Comments

lisastreeter created an issue. See original summary.

lisastreeter’s picture

StatusFileSize
new702 bytes

Patch makes display label required on payment gateway configuration form.

lisastreeter’s picture

Status: Active » Needs review

  • bojanz committed cc76450 on 8.x-2.x authored by lisastreeter
    Issue #3041456 by lisastreeter: Payment gateway display label should be...
bojanz’s picture

Status: Needs review » Fixed

We should decide whether display labels should be allowed to be empty, with a fallback to the main label.

Since no such fallback exists right now, this patch is a valid first step, to at least prevent the crash.

Thanks!

Status: Fixed » Closed (fixed)

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