php 7.1 error with book node edit, Illegal string offset 'weight' and Cannot create references to/from string offsets in drupal_array_set_nested_value() line 6781 /includes/common.inc

Created on 26 July 2017, almost 7 years ago
Updated 18 April 2024, 2 months ago

This new issue continued from post - https://www.drupal.org/node/2656548#comment-12182491 β†’ .

First major problem observed after my move to PHP71, easily reproduced in my configurations.

Create a book node. Add some children. Try to edit and save the book node and I get this error...

Warning: Illegal string offset 'weight' in drupal_array_set_nested_value() (line 6781 of /..../includes/common.inc).
Error: Cannot create references to/from string offsets in drupal_array_set_nested_value() (line 6781 of /..../includes/common.inc).

Drupal does not white screen, but the page presented is the basic error only screen. I was initially concerned thinking that I broke things while creating book node content programmatically. However, the error occurs the same whether I create the book content manually or programmatically... and also when editing/saving every one of my book node content pages.

Also curious is that the error does not occur when logged in as user 1, but does occur when logged in as another user.

And likewise when I drop back to PHP56 the error goes away.

I am also using the course module and book_made_simple module which both tap into book hooks and may be contributing factors.

Articles online say this this error is usually caused by attempting to reference an array key index on a simple string.

What additional information can I provide to help discover the solution?

πŸ› Bug report
Status

RTBC

Version

3.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States webservant316

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024