Undefined array key "depth" BookManager.php

Created on 22 October 2025, 26 days ago

Problem/Motivation

During migrations, I am getting a bunch of warnings 'Undefined array key "depth" BookManager.php'. They refer to this line: $book['depth'] = $parent['depth'] + 1;

I don't know in detail what is causing this. It may be that migration code ought to be setting the depth. However, I noticed that this code has no protection against depth not being set. Indeed $parent could be an empty array (that is the default). If it was, there would also be other errors about undefined array keys.

Proposed resolution

If depth must be set, log and display a better error message. Otherwise, fallback to a sensible default.

Remaining tasks

Figure out what should be done. Implement.

User interface changes

None.

API changes

None except that these warnings would not appear.

Data model changes

None.

πŸ› Bug report
Status

Active

Version

2.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

Not all content is available!

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

Production build 0.71.5 2024