Support

Account

Home Forums Bug Reports Select2 error with no results for User field.

Unread

Select2 error with no results for User field.

  • For a User field type the ajax method ajax_query() in fields/user.php returns nothing via die() if the $choices array is empty, which breaks the Select2 response handler – it hangs rather than saying “no results”.

    Commenting out the die() on line 244 will fix this behavior, or possibly passing an empty array through a filter would be a better long term solution.

    // validate
    if( !$choices ) {
    			
        $choices = apply_filter( 'acf/fields/user/ajax/empty', array() );
    			
    }

    Using ACF Pro 5.1.3

Viewing 1 post (of 1 total)

The topic ‘Select2 error with no results for User field.’ is closed to new replies.