Support

Account

Home Forums ACF PRO Relational Post Object No Results Found

Solved

Relational Post Object No Results Found

  • Hi,

    Having a problem with a relational post object field that is also used within a repeater field.

    The Back Story
    I have two custom post types setup “movie” and “trailer”. I have a the field setup to show on the movie post that relates a trailer to it.

    The Problem
    When I add a row to the repeater, and then click on the dropdown to select a trailer, they all show up fine as far as I can tell. But when I start typing in the name of a trailer to dim down the list, it says “no results found” no matter what I type. So if the trailer name is “Movie Trailer 01” and I type in “Movie” I get “no results found”.

    The Specs
    ACF 5.2.2
    Linux Server (cPanel)
    PHP 5.4
    (not sure what else you need to know…)

    I have attached some screenshots to better display what I’m talking about.

  • Hi @jonjansma

    Could you have hooked a function to the acf/fields/post_object/query filter?

  • Hi James,

    Not that I’m aware of. It was working just fine a few weeks ago, and then this happened. Other fields being used the exact same way on other post types / taxonomies are working just fine as well. Can’t seem to figure out why this one field would be having this problem.

  • My issue wasn’t fixed in the latest update (5.2.3). So, to explain a little more… On the same page to add a post (movie), there are two tabbed areas, one for Trailers and another for Actors. Each uses the repeater field with relational fields within (as seen in the attached images). The one for Actors works the way it should, but the one for Trailers doesn’t search properly as described in the original post.

    Anyone have anything that might help me out?

  • Hey,

    Alright, so I’m happy to announce I’ve figured out the problem, and embarrassed to say it was all my fault, haha.

    In functions.php I had a function set using pre get posts when a user performed a search query, allowing them to only return “movie” post types. I thought this was only affecting the front end, but it was actually affecting the entire site, backend and all. Once, I tweaked that code to basically only pre get posts for front end search queries, everything works as it should.

    Stupid mistake on my part. But very happy to have this finally resolved.

  • Been over 4 years since this was posted, but I ran into the same issue. Had pre_get_posts filter for search without excluding admin (!is_admin()). Thanks JonJansma!

Viewing 6 posts - 1 through 6 (of 6 total)

The topic ‘Relational Post Object No Results Found’ is closed to new replies.