Score:0

Getting "An illegal choice has been detected. Please contact the site administrator." error on checkout page

us flag

Drupal version: 9.5.2

On the checkout page when user tries to add new shipping address by selecting "+ Enter a new address" from selectlist, form for new address loads but shows error message "An illegal choice has been detected. Please contact the site administrator."

This is the screeshot:enter image description here

In the error log following information is getting logged:

Location: https://mysite.com/checkout/20145382/order_information?_wrapper_format=drupal_ajax&ajax_form=1

Referrer: https://mysite.com/checkout/20145382/order_information

Message: Illegal choice 181 in Payment method element.

Severity: Error

What is the cause of this error and how can I solve it??

Jaypan avatar
de flag
Is this a custom form? Have you customized it at all?
Ganesh Chaudhari avatar
us flag
@Jaypan Not a custom form and haven't customized it.
it flag
You're not showing the critical part ... the payment options space. The error is likely just appearing when new address is selected b/c the form is validated and rebuilt via Ajax. Could it be the site doesn't show any valid payment option for the customer?
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.