Support

Account

Home Forums Bug Reports Search filter not working in Relationship field – "No matches found"

Helping

Search filter not working in Relationship field – "No matches found"

  • In case anyone has the same issue:

    I am working on a site that was running ACF 4 with the old premium add-ons. I upgraded to ACF PRO. Everything appeared to be working until the client noticed issues with the search filter in the Relationship fields. They couldn’t select a product (custom post type). The field always said “No matches found”.

    I did some digging and discovered this in the field properties:

    [type] => relationship
    [instructions] => 
    [required] => 0
    [conditional_logic] => 0
    [wrapper] => Array
        (
            [width] => 
            [class] => 
            [id] => 
        )
    
    [post_type] => Array
        (
            [0] => product
        )
    
    [taxonomy] => Array
        (
            [0] => product-category:13||product-category:22||product-category:9||product-category:56||product-category:26||product-category:28||product-category:11||product-category:15||product-category:58||product-category:59||product-category:61||product-category:62||product-category:60||product-category:25||product-category:8||product-category:14||product-category:7||product-category:6||product-category:27||product-category:16||product-category:20||product-category:30||product-category:24||product-category:3||product-category:23||product-category:65||product-category:35||product-category:5||product-category:33||product-category:29||product-category:19||product-category:21||product-category:10||product-category:18||product-category:64||product-category:63||product-category:17||product-category:32||product-category:4||product-category:57||product-category:37||product-category:31||product-category:12
        )
    
    [filters] => Array
        (
            [0] => search
            [1] => taxonomy
        )
    
    [elements] => 
    [min] => 
    [max] => 
    [return_format] => object
    

    The taxonomy property had a bunch of values in it even though the nothing was set in the “Filter by Taxonomy” option for the field.

    I selected a taxonomy to filter by and saved the field. Then I removed the Taxonomy to filter by and saved the field again.

    This wipes the values in the taxonomy property and appears to fix the issue.

  • Hi @ben-pearson,

    Thanks for alerting us about this bug.

    Would you mind opening a new support ticket at support@advancedcustomfields.com with this info?

    This will get to Elliot faster.

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

You must be logged in to reply to this topic.