Clone of #3563266: Upgrade from book 2.0.x fails with TypeError type string on string in book_post_update_allowed_child_type_default6

Same issue inherited from book. we'll fix it in livre first.

Problem/Motivation

Upgrading from a fresh book 2.0.x installation.

Getting this error:
TypeError: Cannot access offset of type string on string in book_post_update_allowed_child_type_default6

Stack of errors:

 [error] TypeError: Cannot access offset of type string on string in book_post_update_allowed_child_type_default6() (line 148 of /www/web/modules/contrib/book/book.post_update.php) #0 /www/vendor/drush/drush/src/Commands/core/UpdateDBCommands.php(291): book_post_update_allowed_child_type_default6(Array)
> #1 /www/vendor/drush/drush/includes/batch.inc(257): Drush\Commands\core\UpdateDBCommands::updateDoOnePostUpdate('book_post_updat...', Array)
> #2 /www/vendor/drush/drush/includes/batch.inc(204): _drush_batch_worker()
> #3 /www/vendor/drush/drush/includes/batch.inc(75): _drush_batch_command('1')
> #4 /www/vendor/drush/drush/src/Commands/core/UpdateDBCommands.php(145): drush_batch_command('1')
> #5 [internal function]: Drush\Commands\core\UpdateDBCommands->process('1', Array)
> #18 {main}.
> TypeError: Cannot access offset of type string on string in /www/web/modules/contrib/book/book.post_update.php on line 148 #0 /www/vendor/drush/drush/src/Commands/core/UpdateDBCommands.php(291): book_post_update_allowed_child_type_default6(Array)
> #1 /www/vendor/drush/drush/includes/batch.inc(257): Drush\Commands\core\UpdateDBCommands::updateDoOnePostUpdate('book_post_updat...', Array)
> [warning] Drush command terminated abnormally.

In ProcessBase.php line 171:

Unable to decode output into JSON: Syntax error

TypeError: Cannot access offset of type string on string in book_post_update_allowed_child_type_default6() (line 148 of /www/html/modules/contrib/book/book.post_update.php).

Steps to reproduce

Install book 2.0.x with this configuration:
book.settings.yml

allowed_type_book: 1
block:
  navigation:
    mode: 'all pages'
child_type_book: book

Then upgrade to book 3.0.x

Then observe bug.

Proposed resolution

See code in merge request

Remaining tasks

Review code in merge request

User interface changes

Allows upgrades without crashing

API changes

See merge request

Data model changes

See merge request

Issue fork livre-3563267

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

joseph.olstad created an issue. See original summary.

joseph.olstad’s picture

Issue summary: View changes
joseph.olstad’s picture

Title: Upgrade from book 2.0.x fails with TypeError type string on string in book_post_update_allowed_child_type_default6 » Upgrade from book 2.0.x fails with TypeError type string on string in book_post_update_allowed_child_type_default6 LIVRE

joseph.olstad’s picture

Status: Active » Needs review
joseph.olstad’s picture

Assigned: joseph.olstad » Unassigned
Status: Needs review » Reviewed & tested by the community

This is going in

joseph.olstad’s picture

Status: Reviewed & tested by the community » Fixed

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.

joseph.olstad’s picture

Status: Fixed » Closed (fixed)

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