Opened 11 years ago
Closed 11 years ago
#23272 closed defect (bug) (fixed)
Notice on class-wp-walker.php
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 3.6 | Priority: | normal |
Severity: | normal | Version: | 2.7 |
Component: | Warnings/Notices | Keywords: | has-patch commit dev-reviewed |
Focuses: | Cc: |
Description
When using the Walker class I get the following notice:
Notice: Undefined offset: 0 in wp-includes/class-wp-walker.php on line 126
//display this element if ( is_array( $args[0] ) ) $args[0]['has_children'] = ! empty( $children_elements[$element->$id_field] );
If I'm not mistaken, this problem is happening because the code assumes that the $args variable is always a non empty array which is not the case.
I'm attaching the code I used to reproduce the problem and a patch to fix it.
Attachments (2)
Change History (6)
Note: See
TracTickets for help on using
tickets.
Patch