WordPress.org

Make WordPress Core

Opened 9 years ago

Closed 9 years ago

#7272 closed defect (bug) (fixed)

Deleting a page parent doesn't properly update all child pages

Reported by: MtDewVirus Owned by:
Milestone: 2.6 Priority: high
Severity: normal Version: 2.6
Component: General Keywords: page, delete
Focuses: Cc:

Description

When a page parent is deleted, the child pages are not all updated properly.

Steps to reproduce

  1. Create a page titled Parent
  2. Create a page titled Child1 with parent page set as Parent
  3. Create a page titled Child2 with parent page set as Parent
  4. Delete Parent page
  5. Child1 gets updated properly in the database. It no longer has a page parent
  6. Child2 still has the parent set to the deleted Parent page.

Tested with r8302

Attachments (1)

7272_parent_page.diff (642 bytes) - added by hailin 9 years ago.
patch

Download all attachments as: .zip

Change History (3)

@hailin
9 years ago

patch

#1 @hailin
9 years ago

update(..) in wp-db.php has 'LIMIT 1'.

When UPDATE should be applied to multiple rows, this produces partial results.
Eg, trac #7272, when a parent page is deleted, we should update all of its children pages, yet only 1 is updated

#2 @ryan
9 years ago

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

(In [8311]) Don't LIMIT updates to 1. Props hailin. fixes #7272

Note: See TracTickets for help on using tickets.