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

CommentFileSizeAuthor
#6 3633443-6.patch566 bytesvensires

Issue fork metatag-3633443

Command icon 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

eduardo morales alberti’s picture

Status: Active » Needs review

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

lmoeni’s picture

Status: Needs review » Reviewed & tested by the community

I just ran into this issue and tested the merge request. It fixes the issue for me.

eduardo morales alberti’s picture

Issue summary: View changes
vensires’s picture

Version: 2.2.2 » 2.2.x-dev
StatusFileSize
new566 bytes

Adding patch based on later MR changes.

RTBC+1 from me.

mrshowerman made their first commit to this issue’s fork.

mrshowerman’s picture

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

johnatas’s picture

RTBC+1, thanks

chemeon’s picture

Also just had this error after updating, patch from MR solved issue and export was as expected based on update. RTBC +1

  • damienmckenna committed d652271d on 2.2.x
    Issue #3633443 by eduardo morales alberti, lmoeni, vensires, mrshowerman...
damienmckenna’s picture

Status: Reviewed & tested by the community » Fixed
Parent issue: » #3633347: Plan for Metatag 2.2.3

Oh for the love of...

Committed. Thank you.

2.2.3 will be out in just a sec.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

rmoestl’s picture

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

damienmckenna’s picture

There's no need to restore from a backup, the error wouldn't have caused any actual problems, besides being annoying.

rmoestl’s picture

Thanks for clarifying!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.