Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
When trying to update a block in Layout Builder on a page that has a language dropdown, the following error is thrown:
Error: Call to undefined method Drupal\Core\Form\FormAjaxException::getStatusCode() in Drupal\dropdown_language\Plugin\Block\DropdownLanguage->build() (line 142 of /var/www/web/modules/composer/dropdown_language/src/Plugin/Block/DropdownLanguage.php)
This is due to the exception not being an HttpException as DropdownLanguage is assuming.
Comment | File | Size | Author |
---|---|---|---|
#3 | after patch.mp4 | 16.78 MB | paraderojether |
#3 | before patch.png | 483.34 KB | paraderojether |
Issue fork dropdown_language-3334364
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
amelio CreditAttribution: amelio at Investis Digital commentedComment #3
paraderojether CreditAttribution: paraderojether at Promet Source commentedHi @amelio
I applied patch #2 against the Dropdown Language module version 3.1.0 with Drupal core version 9.4.7 and the patch works fine, a block in Layout Builder on a page that has a language dropdown can be updated without any error.
Please look at the file attached.
Thank You.
Comment #4
SKAUGHTComment #6
AnybodyComment #8
AnybodyCreated MR from #2
Comment #10
AnybodyFixed in 3.x and 4.x. Totally makes sense.