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
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
Comment #2
joseph.olstadComment #3
joseph.olstadComment #5
joseph.olstadComment #6
joseph.olstadThis is going in
Comment #7
joseph.olstadComment #9
joseph.olstadhttps://www.drupal.org/project/livre/releases/1.0.5