WordPress.org

Make WordPress Core

Opened 7 years ago

Closed 5 years ago

#4660 closed defect (bug) (invalid)

get_pages() ignores `hierarchical' arg when a cache for a query hits

Reported by: reedom Owned by:
Milestone: Priority: normal
Severity: normal Version: 2.2.1
Component: Template Keywords: cache
Focuses: Cc:

Description

get_pages() in post.php will shortcut if a cache for a query hits.
In that case it misses a chance to call `get_page_children()' so that it results non-hierarchical-ordered page array.

representation

  1. create some pages hierarchical.
  2. place the attatched file test_get_pages_order.php in /wp_includes.
  3. run the script from shell.

Attachments (2)

test_get_pages_order.php (742 bytes) - added by reedom 7 years ago.
get_pages_order.2.2.1.patch (875 bytes) - added by reedom 7 years ago.
Please test well since I haven't.

Download all attachments as: .zip

Change History (6)

reedom7 years ago

comment:1 foolswisdom7 years ago

  • Milestone set to 2.4 (future)

Hi Reedom, please attach a patch vs trunk.

comment:2 reedom7 years ago

I missed to mention its background.

This problem occurs only when there is one or more 'the_pages' filters and any of them change order of `$pages' array.

reedom7 years ago

Please test well since I haven't.

comment:3 darkdragon6 years ago

  • Component changed from General to Template

comment:4 DD325 years ago

  • Milestone 2.9 deleted
  • Resolution set to invalid
  • Status changed from new to closed

the get_page_children() call is before the wp_cache_set() call under current-day trunk, So i'm closing this ticket as invalid, as it should no longer be needed.

Note: See TracTickets for help on using tickets.