Make WordPress Core

Opened 19 years ago

Closed 19 years ago

#5457 closed defect (bug) (fixed)

deleting a nested page from Manage => Pages causes query inconsistency

Reported by: hailin Owned by: hailin
Priority: high Milestone: 2.5
Component: General Version: 2.5
Severity: major Keywords:
Cc: Focuses:

Description (last modified by westi)

Given the following pages:

ID  Title        post_parent
4   sunpage     0 
5   -moonpage   4
6   --starpage  5
7  rainpage     0 

if we remove moonpage, and do page refresh, starpage is not displayed.
The root cause is that, after removing moonpage, the internal db state and cache may be out of sync. ie, querying phpmyadmin reveals the starpage has post_parent=4; yet
print_r(pages) within page_rows() reveals starpage has post_parent=5.

This can cause all sorts of perplexing problems if not fixed.

Attachments (2)

5457_clean_cache.diff​ (1.1 KB ) - added by hailin 19 years ago.
patch
5457_clean_cache_2.diff​ (666 bytes ) - added by hailin 19 years ago.
additional patch to clean the cache of the orphaned pages

Download all attachments as: .zip

Change History (9)

#1 @westi
19 years ago

  • Description modified (diff)

#2 @lloydbudd
19 years ago

  • Milestone 2.5 → 2.4
  • Version → 2.4

#3 @ryan
19 years ago

In wp_delete_post() where we update children of the deleted page to point to the parent, we need to get the IDs of all affected pages and do a clean_page_cache() for each.

#4 @hailin
19 years ago

  • Owner changed from anonymous to hailin
  • Status new → assigned

Fixed and tested on both wporg and wpcom.

The problem can actually be quite purplexing to users, as sometimes child page is displayed correctly; Yet after refreshing the page, it is displayed incorrectly. Then refresh again, it is correct/incorrect again....

#5 @ryan
19 years ago

  • Resolution → fixed
  • Status assigned → closed

(In [6382]) clean page cache when reparenting pages after deletion. Props hailin. fixes #5457

#6 @hailin
19 years ago

  • Resolution fixed
  • Status closed → reopened

@hailin
19 years ago

additional patch to clean the cache of the orphaned pages

#7 @ryan
19 years ago

  • Resolution → fixed
  • Status reopened → closed

(In [6403]) Clean cache for orphaned pages. Props hailin. fixes #5457

Note: See TracTickets for help on using tickets.