TypeError when adding book page

Created on 2 October 2023, 11 months ago
Updated 17 October 2023, 11 months ago

When trying to add a book page to a book as a low privilege user the following TypeError occurs:

TypeError: Drupal\Component\Utility\NestedArray::getValue(): Argument #2 ($parents) must be of type array, null given, called in /app/drupal9/core/lib/Drupal/Core/Field/WidgetBase.php on line 426 in Drupal\Component\Utility\NestedArray::getValue() (line 69 of /app/drupal9/core/lib/Drupal/Component/Utility/NestedArray.php)
#0 /app/drupal9/core/lib/Drupal/Core/Field/WidgetBase.php(426): Drupal\Component\Utility\NestedArray::getValue(Array, NULL)
#1 /app/drupal9/core/lib/Drupal/Core/Entity/Entity/EntityFormDisplay.php(270): Drupal\Core\Field\WidgetBase->flagErrors(Object(Drupal\content_moderation\Plugin\Field\ModerationStateFieldItemList), Object(Symfony\Component\Validator\ConstraintViolationList), Array, Object(Drupal\Core\Form\FormState))

Steps to reproduce:
- Standard install of Drupal 9.5.11
- Install book module
- Install workflow module and content moderation module
- Edit the standard workflow and apply it to all content types
- Create a content editor user with the 'content editor' role
- Give the content editor role permission to 'create new drafts' as well as all book related permissions
- Log in as admin and create a new basic page, go to the book tab and select 'create new book' and save and publish it
- Log in as content editor and create a new basic page and save it (as 'draft')
- Log in as admin and publish the new basic page that was created by the content editor
- Log in as content editor and view the newly created page
- Click on the 'Outline' tab at the top of the page and add the new page to the book that was created earlier
- The TypeError above is thrown when you save the page

๐Ÿ› Bug report
Status

Needs work

Version

11.0 ๐Ÿ”ฅ

Component
Fieldย  โ†’

Last updated 1 day ago

Created by

๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom DuttonMa

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024