- Issue created by @lstirk
- Merge request !2Fix PHP warnings on node/add form caused by default_value set to -1. → (Merged) created by lstirk
- Status changed to Fixed
8 months ago 7:58am 11 April 2024
When creating a new node that is part of a book the module gives the following warnings in the logs.
Warning: Trying to access array offset on value of type bool in Drupal\book\BookManager->bookSubtreeData() (line 1147 of /var/www/html/docroot/core/modules/book/src/BookManager.php)
Warning: Trying to access array offset on value of type bool in Drupal\book_link_weight\Form\BookLinkWeightForm->alterBookOutlineForm() (line 71 of /var/www/html/docroot/modules/contrib/book_link_weight/src/Form/BookLinkWeightForm.php)
This is caused by $form['book']['pid']['#default_value']
been = '-1' so no tree data is been loaded.
I will submit a merge request with a possible fix.
Fixed
1.1
Code