Illegal choice in Shipping method element AND The specified #ajax callback is empty or not callable.

Created on 12 April 2023, over 1 year ago
Updated 28 April 2023, over 1 year ago

Problem/Motivation

I have a multilingual shop for stamps running and got 2 shipping methods, where the user can choose from. when i´m logged in and go threw the buying proceture then it shows me the 2 possibilities and when i choose one of them it gives me the following error in "Recent log messages":

Location https://mywebsite.tld/en/checkout/19/order_information?_wrapper_format=d...
Referrer https://mywebsite.tld/en/checkout/19/order_information
Message Symfony\Component\HttpKernel\Exception\HttpException: The specified #ajax callback is empty or not callable. in Drupal\Core\Form\FormAjaxResponseBuilder->buildResponse() (line 67 of /www/web/core/lib/Drupal/Core/Form/FormAjaxResponseBuilder.php).
Severity Error

when i try to buy as guest i only get:
There are no shipping rates available for this address.

Sometimes it works - no clue why, but very very rarely, like 1 out of 10. When i press the "edit" link then it is possible to change the address but not the shipping method.

ad) 14.04.2023
i added a 3rd shipping method and recognized the following: when you add 1 stamp to the cart and want to checkout then all 3 shipping methods are possible to use because #1 is a letter with tracking and it checks the weight (max. 75g), #2 is a registered letter (weight max. 75g) and the last one is a package up to 2kg. when i choose the last one it works, so it seems that it has problems with the case that there are 3 shipping possibilities and all are valid.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

2.0

Component

Code

Created by

🇦🇹Austria gr4phic3r

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @gr4phic3r
  • 🇦🇹Austria gr4phic3r

    i found now the reason/bug why it didn´t work:

    i run a multilingual site and i set up 2 package types at COMMERCE > CONFIGURATION > SHIPPING > PACKAGE TYPES, one for an envelope up to 70g and one for a shipping bag up to 1800g. under COMMERCE > CONFIGURATION > SHIPPING > SHIPMENT TYPES is the default one, nothing has been touched there.

    then i set up under COMMERCE > SHIPPING METHODS following methods:
    - Normal letter with tracking
    - Registered letter with tracking
    - Shipping bag

    ... and because there are different fees national, eu and international wide, I checked under CUSTOMER the checkbox ADDRESS and chose Austria (national). I did this with all methods. Then i also checked SHIPMENT WEIGHT under SHIPMENT and chose "Less than or equal" and entered 70g for the letters and 1800g for the shipping bag. With this setting it gave me the error described above and also the Illegal choice error which others also had. When i remove the settings under SHIPMENT it works normally.

Production build 0.71.5 2024