Skip to content

Issue #3553911: Fix undefined array key 'depth' in BookManager

Add defensive checks with logging when parent book link is missing or invalid. This prevents PHP warnings when creating nodes with invalid parent IDs or when dealing with corrupted book data.

The fix adds isset() checks before accessing parent['depth'] in three locations:

  • getBookParents() line 326
  • saveBookLink() line 870
  • saveBookLink() line 882

When a parent is missing, the system now:

  1. Logs a warning for administrators
  2. Uses depth 0 as fallback (treats node as new root)
  3. Allows the operation to continue gracefully

Closes #3553911

Merge request reports

Loading