Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix use of 'fields'=>'ids', which should return post IDs #300

Closed
wants to merge 3 commits into from

Conversation

danielbachhuber
Copy link
Contributor

No description provided.

@danielbachhuber
Copy link
Contributor Author

@ataylorme We have a bit of a problem with this, unfortunately.

Solr Power fills in posts from Solr on the_posts filter: https://github.com/WordPress/WordPress/blob/06fa4161aa74619239cf27017d124081c825684a/wp-includes/class-wp-query.php#L3007

When we return an array of IDs in the_posts filter, they get transformed into proper post objects: https://github.com/WordPress/WordPress/blob/06fa4161aa74619239cf27017d124081c825684a/wp-includes/class-wp-query.php#L3010-L3020

The workaround would be to use the posts_pre_query filter, added in WordPress 4.6. But, we need to increase the minimum version to 4.6: https://github.com/WordPress/WordPress/blob/06fa4161aa74619239cf27017d124081c825684a/wp-includes/class-wp-query.php#L2781

I can't think of an alternative fix at this point.

I noticed this issue while working on #299. There are lots of tests like this:

image

@ataylorme
Copy link
Contributor

@danielbachhuber per Josh's comment in #284 I think bumping minimum version is okay. Please proceed.

cc @joshkoenig

@danielbachhuber
Copy link
Contributor Author

per Josh's comment in #284 I think bumping minimum version is okay. Please proceed.

I confirmed today with Josh. I'll do so in a separate PR.

@ataylorme
Copy link
Contributor

@danielbachhuber what's the status of this work? I see the unit tests are failing. Wondering if we should try to get this into 1.4 which I'd like to release soon

@danielbachhuber
Copy link
Contributor Author

what's the status of this work?

It's on my plate but I haven't started. I'll need to do a fair amount of refactoring to use posts_pre_query.

Wondering if we should try to get this into 1.4 which I'd like to release soon

Is 1.5 to 2 weeks fine? I can work on the refactor early next.

@ataylorme
Copy link
Contributor

Saving it for 1.5 is fine. I'll be out on vacation until 9/5 starting next week but can review and cut a release when I return.

@ataylorme ataylorme added this to the 1.5 milestone Aug 16, 2017
@ataylorme
Copy link
Contributor

@danielbachhuber this seems to be the last thing in the 1.5 milestone. Still plan on getting this in for that release?

@danielbachhuber
Copy link
Contributor Author

Closing in favor of #336

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants