Unable to perform database update on 11.2.2 - set_menu_block_depth_to_null_if_zero

Created on 30 June 2025, 13 days ago

Hello all,

A routine database update from Drupal 11.2.1 to 1.2.2 fails because of some Block Module misconfiguration:

Here is the error message on Drush :

[error] Update aborted by: block_post_update_set_menu_block_depth_to_null_if_zero

Error message when attempting the update on the front end :

module block
Update set_menu_block_depth_to_null_if_zero

Error : InvalidArgumentException : $string ("1") must be a string. in Drupal\Core\StringTranslation\TranslatableMarkup->__construct() (ligne 132 de /home/accountname/public_html/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php).

Is there anything I can fix directly in the database? Thanks!

💬 Support request
Status

Active

Version

11.2 🔥

Component

block.module

Created by

🇨🇦Canada mediameriquat

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

Comments & Activities

  • Issue created by @mediameriquat
  • 🇨🇦Canada mediameriquat

    One possible solution is to uninstall faulty blocks from your theme, perform the upgrade, and reinstall the blocks.

    In my case, the culprit was the Main Menu block. My site is quite old and was updated from 8 > 11, so it seems there is a problem with "legacy" menus.

  • 🇧🇪Belgium bart lambert

    In my case, I used adaptieve theme in D10. I thought by fixing the issues manually i would be able to use this theme in D11.

    I had to remove all the installed themes before being able to run updb succesfully!
    To bad AT-theme is not updating to D11

  • 🇬🇧United Kingdom longwave UK

    Is it possible to get a full stack trace from where that exception happens? The update hook itself doesn't use TranslatableMarkup so it's not clear to me how or why this happens.

  • 🇨🇦Canada mediameriquat

    @Bart Lambert

    Interesting... I am also using AdaptiveTheme on that particular website. Although v. 7.1.1 is marked compatible with Drupal 11, this may be a theme-specific issue.

Production build 0.71.5 2024