Make WordPress Core

Opened 14 years ago

Closed 14 years ago

#11205 closed defect (bug) (fixed)

Behaviour when parent page is trashed is undefined

Reported by: sirzooro's profile sirzooro Owned by:
Milestone: 2.9 Priority: normal
Severity: normal Version: 2.9
Component: Trash Keywords: needs-patch
Focuses: Cc:

Description

Create two pages: Parent and Child. Set the former as a parent for the latter. Then trash Parent page. When you start editing the Child page, WP will display two notices:

Notice: Undefined offset: 1 in C:\wordpress29.local\wp-includes\post.php on line 2603
Notice: Trying to get property of non-object in C:\wordpress29.local\wp-includes\post.php on line 2603

It should be easy to remove these warnings. But there is another problem: when you save Child post, you will lost Parent-Child relation. Keep in mind that user may want to untrash the Parent page later.

Change History (5)

#1 @ryan
14 years ago

  • Component changed from Administration to Trash

#2 @caesarsgrunt
14 years ago

Odd - I don't get this error.

It is true, however, that editing the child of a trashed page loses the parent-child relation. I'm not sure what the alternative would be, however. Perhaps the parent could be shown in the list even if it is trashed, but that could be confusing. Maybe we need Jane's input here for the UI.

#3 @sirzooro
14 years ago

I have confirmed that these warnings appears with default theme and no active plugins. Make sure you have some fix for #11203 in place.

#4 @caesarsgrunt
14 years ago

Even with the fix for #11203 in place, I don't get the notices.

#5 @azaozz
14 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [12279]) Get the right number of pages then excluding a tree, fixes #11205

Note: See TracTickets for help on using tickets.