Problem/Motivation
Error after update 2.2.2, Html::escape expects a string, but receives an array "[403, 404]"
> [notice] Update started: metatag_post_update_v2_06_error_page_defaults
> TypeError: Drupal\Component\Utility\Html::escape(): Argument #1 ($text) must be of type string, array given, called in /var/www/html/docroot/core/lib/Drupal/Component/Render/FormattableMarkup.php on line 238 in /var/www/html/docroot/core/lib/Drupal/Component/Utility/Html.php on line 433 #0 /var/www/html/docroot/core/lib/Drupal/Component/Render/FormattableMarkup.php(238): Drupal\Component\Utility\Html::escape()
> #1 /var/www/html/docroot/core/lib/Drupal/Component/Render/FormattableMarkup.php(187): Drupal\Component\Render\FormattableMarkup::placeholderEscape()
> #2 /var/www/html/docroot/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php(192): Drupal\Component\Render\FormattableMarkup::placeholderFormat()
> #3 /var/www/html/docroot/core/lib/Drupal/Core/StringTranslation/TranslatableMarkup.php(235): Drupal\Core\StringTranslation\TranslatableMarkup->render()
> #4 /var/www/html/vendor/drush/drush/src/Commands/core/UpdateDBCommands.php(330): Drupal\Core\StringTranslation\TranslatableMarkup->__toString()
> #5 /var/www/html/vendor/drush/drush/includes/batch.inc(259): Drush\Commands\core\UpdateDBCommands::updateDoOnePostUpdate()
> #6 /var/www/html/vendor/drush/drush/includes/batch.inc(205): _drush_batch_worker()
> #7 /var/www/html/vendor/drush/drush/includes/batch.inc(76): _drush_batch_command()
> #8 /var/www/html/vendor/drush/drush/src/Commands/core/UpdateDBCommands.php(145): drush_batch_command()
> #9 [internal function]: Drush\Commands\core\UpdateDBCommands->process()
> #10 /var/www/html/vendor/consolidation/annotated-command/src/CommandProcessor.php(276): call_user_func_array()
> #11 /var/www/html/vendor/consolidation/annotated-command/src/CommandProcessor.php(212): Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback()
> #12 /var/www/html/vendor/consolidation/annotated-command/src/CommandProcessor.php(175): Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter()
> #13 /var/www/html/vendor/consolidation/annotated-command/src/AnnotatedCommand.php(389): Consolidation\AnnotatedCommand\CommandProcessor->process()
> #14 /var/www/html/vendor/symfony/console/Command/Command.php(341): Consolidation\AnnotatedCommand\AnnotatedCommand->execute()
> #15 /var/www/html/vendor/symfony/console/Application.php(1125): Symfony\Component\Console\Command\Command->run()
> #16 /var/www/html/vendor/drush/drush/src/Application.php(201): Symfony\Component\Console\Application->doRunCommand()
> #17 /var/www/html/vendor/symfony/console/Application.php(357): Drush\Application->doRunCommand()
> #18 /var/www/html/vendor/symfony/console/Application.php(196): Symfony\Component\Console\Application->doRun()
> #19 /var/www/html/vendor/drush/drush/src/Runtime/Runtime.php(113): Symfony\Component\Console\Application->run()
> #20 /var/www/html/vendor/drush/drush/src/Runtime/Runtime.php(40): Drush\Runtime\Runtime->doRun()
> #21 /var/www/html/vendor/drush/drush/drush.php(140): Drush\Runtime\Runtime->run()
> #22 /var/www/html/vendor/bin/drush.php(119): include('...')
> #23 {main}
> [warning] Drush command terminated abnormally.
Steps to reproduce
Update to 2.2.2 metatag on Drupal 11.4 and run drush updb -y
Comments
Comment #3
eduardo morales albertiThe metatag update is applied, but the TypeError makes drush updb exit with an error, so subsequent post-updates are skipped, and drush deploy stops before config:import, cache:rebuild and the deploy hooks.
Comment #4
lmoeniI just ran into this issue and tested the merge request. It fixes the issue for me.
Comment #5
eduardo morales albertiComment #6
vensiresAdding patch based on later MR changes.
RTBC+1 from me.
Comment #8
mrshowermanI had the same issue, and applying a patch from the MR fixes it.
Thanks for providing the fix so quickly.
I took the opportunity to add a fix to a typo in the info message.
Comment #9
johnatas commentedRTBC+1, thanks
Comment #10
chemeon commentedAlso just had this error after updating, patch from MR solved issue and export was as expected based on update. RTBC +1
Comment #12
damienmckennaOh for the love of...
Committed. Thank you.
2.2.3 will be out in just a sec.
Comment #14
rmoestl commentedThanks for the quick fix.
By sheer coincidence I updated the local version of my site to 2.2.2 and saw this failure.
As far as I can see it was only a problem around logging that the post update method ran successfully.
Did that failure hold back anything crucial in the update process so that it'd be better to restore the database?
Btw. the config changes were made successfully.
Comment #15
damienmckennaThere's no need to restore from a backup, the error wouldn't have caused any actual problems, besides being annoying.
Comment #16
rmoestl commentedThanks for clarifying!