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!

Comments

mediameriquat created an issue. See original summary.

mediameriquat’s picture

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.

bart lambert’s picture

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

longwave’s picture

Status: Active » Postponed (maintainer needs more info)
Issue tags: +Needs steps to reproduce

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.

mediameriquat’s picture

@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.

ralfmattheus’s picture

Hi @longwave
It would be great if you could have a look at this issue.
Here is the information I can provide:

Drupal-versie 11.2.2
PHP 8.3.22
Database 10.6.22-MariaDB-cll-lve-log
at_tool 3.1.2 AdaptiveTheme

InvalidArgumentException: $string ("1") must be a string. in Drupal\Core\StringTranslation\TranslatableMarkup->__construct() (line 132 of /home/example.com/public_html/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php).

#0 /home/example.com/public_html/core/modules/locale/src/LocaleConfigManager.php(184): Drupal\Core\StringTranslation\TranslatableMarkup->__construct()
#1 /home/example.com/public_html/core/modules/locale/src/LocaleConfigManager.php(167): Drupal\locale\LocaleConfigManager->getTranslatableData()
#2 /home/example.com/public_html/core/modules/locale/src/LocaleConfigManager.php(167): Drupal\locale\LocaleConfigManager->getTranslatableData()
#3 /home/example.com/public_html/core/modules/locale/src/LocaleConfigManager.php(145): Drupal\locale\LocaleConfigManager->getTranslatableData()
#4 /home/example.com/public_html/core/modules/locale/src/LocaleConfigSubscriber.php(128): Drupal\locale\LocaleConfigManager->getTranslatableDefaultConfig()
#5 /home/example.com/public_html/core/modules/locale/src/LocaleConfigSubscriber.php(92): Drupal\locale\LocaleConfigSubscriber->updateLocaleStorage()
#6 /home/example.com/public_html/vendor/symfony/event-dispatcher/EventDispatcher.php(206): Drupal\locale\LocaleConfigSubscriber->onConfigSave()
#7 /home/example.com/public_html/vendor/symfony/event-dispatcher/EventDispatcher.php(56): Symfony\Component\EventDispatcher\EventDispatcher->callListeners()
#8 /home/example.com/public_html/core/lib/Drupal/Core/Config/Config.php(230): Symfony\Component\EventDispatcher\EventDispatcher->dispatch()
#9 /home/example.com/public_html/core/lib/Drupal/Core/Config/Entity/ConfigEntityStorage.php(260): Drupal\Core\Config\Config->save()
#10 /home/example.com/public_html/core/lib/Drupal/Core/Entity/EntityStorageBase.php(487): Drupal\Core\Config\Entity\ConfigEntityStorage->doSave()
#11 /home/example.com/public_html/core/lib/Drupal/Core/Config/Entity/ConfigEntityStorage.php(239): Drupal\Core\Entity\EntityStorageBase->save()
#12 /home/example.com/public_html/core/lib/Drupal/Core/Entity/EntityBase.php(370): Drupal\Core\Config\Entity\ConfigEntityStorage->save()
#13 /home/example.com/public_html/core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php(618): Drupal\Core\Entity\EntityBase->save()
#14 /home/example.com/public_html/core/lib/Drupal/Core/Config/Entity/ConfigEntityUpdater.php(193): Drupal\Core\Config\Entity\ConfigEntityBase->save()
#15 /home/example.com/public_html/core/lib/Drupal/Core/Config/Entity/ConfigEntityUpdater.php(148): Drupal\Core\Config\Entity\ConfigEntityUpdater->doOne()
#16 /home/example.com/public_html/core/modules/block/block.post_update.php(43): Drupal\Core\Config\Entity\ConfigEntityUpdater->update()
#17 /home/example.com/public_html/core/includes/update.inc(250): block_post_update_set_menu_block_depth_to_null_if_zero()
#18 /home/example.com/public_html/core/includes/batch.inc(298): update_invoke_post_update()
#19 /home/example.com/public_html/core/includes/batch.inc(139): _batch_process()
#20 /home/example.com/public_html/core/includes/batch.inc(95): _batch_do()
#21 /home/example.com/public_html/core/modules/system/src/Controller/DbUpdateController.php(201): _batch_page()
#22 [internal function]: Drupal\system\Controller\DbUpdateController->handle()
#23 /home/example.com/public_html/core/lib/Drupal/Core/Update/UpdateKernel.php(115): call_user_func_array()
#24 /home/example.com/public_html/core/lib/Drupal/Core/Update/UpdateKernel.php(76): Drupal\Core\Update\UpdateKernel->handleRaw()
#25 /home/example.com/public_html/update.php(27): Drupal\Core\Update\UpdateKernel->handle()
#26 {main}
ralfmattheus’s picture

This morning I tried the database update script again, but it gives the same error as before.