Plugin Directory

Changeset 3105590

Timestamp:
06/21/2024 09:57:56 AM (7 weeks ago)
Author:
whiteshadow
Message:

Fix PHP warning "Undefined array key "parent" in ... menu-editor-core.php"

It's not clear how exactly an orphaned item ends up without a 'parent' key (unidentified bug?), but moving the item to the top level still seems like a reasonable fallback in that situation.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • admin-menu-editor/trunk/includes/menu-editor-core.php

    r3098158 r3105590  
    19231923        //Move orphaned items back to their original parents.
    19241924        foreach($orphans as $item) {
    1925             $defaultParent = $item['defaults']['parent'];
    1926             //TODO: Apparently 'parent' might not exist in some configurations. Unknown bug.
     1925           
     1926           
    19271927            if ( isset($defaultParent) && isset($tree[$defaultParent]) ) {
    19281928                $tree[$defaultParent]['items'][] = $item;
Note: See TracChangeset for help on using the changeset viewer.