Posted By
Karl Fogel
On
November 12, 2014 @ 12:02 pm
In
Miscellaneous,SOLVED as a Service |
No Comments

This is a public service announcement for anyone else who runs WordPress straight from SVN trunk and found their site broken after upgrading recently (probably after svn update took their site across the WordPress 4.1 boundary), such that instead of showing recent posts on the front page, you would see only this message:

I haven’t analyzed this in depth, but here’s what I think is going on:

The workaround implemented by that line (that is, setting ‘value’ explicitly albeit only to the empty string, in order to get the right SQL result) is what’s recommended by WordPress bug #23268[1]. However, that bug was fixed in changeset 27689[2], which (confusingly to those of us not accustomed to development involving multiple SVN trees, yikes) made it to http://core.svn.wordpress.org/trunk in r27528:

------------------------------------------------------------------------
r27528 | wonderboymusic | 2014-03-24 14:57:15 -0500 (Mon, 24 Mar 2014) | 10 lines
Changed paths:
M /trunk/wp-includes/meta.php
When using `meta_query` in a `WP_Query`, passing `NOT EXISTS` or `''`
to `compare` should not require `value` to be set. The resulting SQL
should then produce the appropriate `OR` clause for existence of
non-existence after passing the query to the `$key_only_queries` stack
internally.
Adds unit tests.
Props chrisguitarguy, for the original patch.
Fixes #23268.
Built from https://develop.svn.wordpress.org/trunk@27689
------------------------------------------------------------------------

Okay, so the bug was fixed in WordPress core, and when I updated, I got the fix.

Unfortunately, the stealth-publish[3] plugin hasn’t gotten the memo yet. That plugin’s latest version is 2.4, and hasn’t been updated since January 2014 — a couple of months before the relevant WP core bugfix. And the workaround in the code is now not only unnecessary, but actually causes an SQL syntax error — which is probably reasonable, since passing a value doesn’t really make sense in a NOT EXISTS test. It’s just that anyone who was using the workaround needs to stop doing so immediately.

I hope that stealth-plugin is still being maintained by its author. It’s hard to tell right now because the stealth-publish home page[4] is currently down for maintenance: