Errors if book.settings allowed_types is not configured

Created on 26 November 2024, 5 months ago

Problem/Motivation

If book.settings key allowed_types is not configured, error messages will appear.

This appears on admin/structure/book/settings:

Warning: foreach() argument must be of type array|object, null given in Drupal\Core\Render\Element\Checkboxes::valueCallback() (line 113 of /.../core/lib/Drupal/Core/Render/Element/Checkboxes.php)

This can appear on admin/content or when deleting a book page:

TypeError: in_array(): Argument #2 ($haystack) must be of type array, null given in in_array() (line 511 of /.../modules/contrib/book/book.module).

Proposed resolution

Make the code robust against allowed_types not being set.

Remaining tasks

Implement.

User interface changes

None.

API changes

None.

Data model changes

None.

πŸ› Bug report
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡¨πŸ‡¦Canada Liam Morland Ontario, CA πŸ‡¨πŸ‡¦

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024