Jump to content

"At least one of these fields is populated" - selector broken after PW update


cst989
 Share

Recommended Posts

We have just updated a ProcessWire site from 3.0.184 to 3.0.229 and the following selector has stopped working:

template=news-post,image|slideshow|video_embed!='',sort=-created

In other words, I'm trying to grab the latest articles for featuring on my homepage, as long as they have at least an image, slideshow or video - if not, they're not suitable for the location.

Is there an obvious reason this should've stopped working in the latest version, and/or an alternative approach?

Link to comment
Share on other sites

I solved this by creating a new field and saving it with a hook, essentially...

if($page->template == "news-post") {
	$page->set('has_media', $page->image->count || $page->slideshow->count || !empty($page->video_embed));
}

now I can just check if 

has_media=1

But I'm still curious why my old approach stopped working

  • Like 1
Link to comment
Share on other sites

You could try the latest dev (3.0.239) to see if it's an issue that has been fixed since 3.0.229 was released. If it's still present in the latest dev then please open a GitHub issue so Ryan can investigate.

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...