Opened 14 years ago
Closed 14 years ago
#17118 closed defect (bug) (fixed)
[17552] can generate notices for meta_query
Reported by: | nacin | Owned by: | |
---|---|---|---|
Milestone: | 3.2 | Priority: | normal |
Severity: | normal | Version: | 3.1 |
Component: | Query | Keywords: | has-patch |
Focuses: | Cc: |
Description
Just published a new post, and saw:
Notice: Undefined index: meta_query in /Users/nacin/Sites/beta/wp-includes/query.php on line 2469 Notice: Undefined index: meta_query in /Users/nacin/Sites/beta/wp-includes/query.php on line 2470
Setting to 3.1.2 for now as I haven't yet evaluated if these notices are indicative of an actual bug being triggered.
Attachments (3)
Change History (17)
#2
@
14 years ago
I was doing a wp_query->set() on pre_get_posts, but avoided meta query. It triggered query_vars_changed but meta query wasn't set for some reason.
#3
@
14 years ago
Debugged a little bit further... its happens when directly calling $wp_query->query();
which is used in wp_get_post_autosave()
. Adding meta_query
in $wp_query->fill_query_vars()
solves it..
#6
in reply to:
↑ description
@
14 years ago
- Keywords fixed-major added
Replying to nacin:
Setting to 3.1.2 for now as I haven't yet evaluated if these notices are indicative of an actual bug being triggered.
Is this for 3.1.2 or 3.2??
#7
@
14 years ago
Either of these patches should go in, if running this block of code with meta_query not set produces side effects. It doesn't look like it does anything though if that's the case.
#9
follow-up:
↓ 10
@
14 years ago
I think this can be closed as "Fixed" if #17165 is committed.
[17699] (the main commit in the above ticket) removed the code in question here. I cant duplicate it in 3.1, I've tried various pre_get_post filters too.. I remember coming across this exact issue a different way (and thought it was fixed before 3.1 was released)
#10
in reply to:
↑ 9
@
14 years ago
Replying to dd32:
I think this can be closed as "Fixed" if #17165 is committed.
I cant duplicate it in 3.1,
To reproduce this issue in 3.1.1, alter the query vars using pre_get_posts filter then edit a post which has autosaves.
I've tried various pre_get_post filters too.. I remember coming across this exact issue a different way (and thought it was fixed before 3.1 was released)
IIRC, before 3.1 there was no meta_query
.
#11
@
14 years ago
To reproduce this issue in 3.1.1, alter the query vars using pre_get_posts filter then edit a post which has autosaves.
Cheers, I'll give that one a shot, Chances are, what I saw was the same problem, caused by a different code-path.
IIRC, before 3.1 there was no meta_query.
3.1-bleeding was where I saw it :)
#12
@
14 years ago
- Component changed from General to Query
- Milestone changed from 3.2 to 3.1.3
- Version set to 3.1
I cant duplicate it in 3.1
Was a PEBKAC issue :)
Both of these patches prevent meta_key & meta_value from being set on filters such as pre_get_posts.
However, This is no longer an issue in trunk, and historically we've not patched Notice's in point releaes..
Attaching a patch which would fix it for 3.1.x and assigning to 3.1.3
#13
@
14 years ago
Both of these patches prevent meta_key & meta_value from being set on filters such as pre_get_posts.
And I was wrong, Greuben's 17118.diff patch does indeed allow it to work, leading to the patch i uploaded being overkill. Short of a plugin unsetting meta_query on the posts_search filter, there's nothing that would cause it to not work.
The only possible reason I think of is unsetting
meta_query
usingpre_get_posts
filter... if that is the case then addingmeta_query
inWP_Query::fill_query_vars()
will solve it.