Skip to content

Merge get_posts() and get_pages()#3178

Closed
spacedmonkey wants to merge 25 commits intoWordPress:trunkfrom
spacedmonkey:fix/get_pages
Closed

Merge get_posts() and get_pages()#3178
spacedmonkey wants to merge 25 commits intoWordPress:trunkfrom
spacedmonkey:fix/get_pages

Conversation

@spacedmonkey
Copy link
Member

Trac ticket: https://core.trac.wordpress.org/ticket/12821


This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

@spacedmonkey spacedmonkey self-assigned this Sep 4, 2022
@peterwilsoncc
Copy link
Contributor

I pushed up a PR with just the tests to compare the results with trunk.

I'm seeing a couple of minor differences in the new tests for the SQL queries but I think they may be false positives. As the legacy queries don't have ordering statements, there may end up been some unpredictable behavior across different MySQL versions/engines. Good times.

Copy link
Contributor

@peterwilsoncc peterwilsoncc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is looking good but added a few notes inline.

The code makes sense but it would be good to nail down the different tests results on this branch and trunk that I mentioned before we all went on holiday.


/**
* Filters the retrieved list of pages.
*
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there are any changes to parsed_args this will need an @since tag noting them,

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't touch the $parsed_args variable. We may consider adding $query_args to this filter, for better context.

Copy link
Member

@joemcgill joemcgill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The latest updates here look good to me. @adamsilverstein or @peterwilsoncc could one of you confirm?

clean_post_cache( $pages[0]->ID );
$this->assertNotEquals( $time1, $time2 = wp_cache_get( 'last_changed', 'posts' ) );

get_post( $pages[0]->ID );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the addition of this function call here meant to test, a specific side effect that we're trying to catch here? An inline comment, or better yet, a single new test case for this issue would be better. Not a blocker.

@spacedmonkey
Copy link
Member Author

Committed in eb6bf15

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants