Warning: RWMB_Post_Field::search_by_title() expected to be a reference

Support General Warning: RWMB_Post_Field::search_by_title() expected to be a reference

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #32601
    pluginovenpluginoven
    Participant

    After updating to Meta-Box version version 5.5.0, I am getting the following warning on a post field displayed using a select-advanced field-type with values populated with a query_args filter -- (is this why no one talks to me at cocktail parties?)

    Warning: Parameter 2 to RWMB_Post_Field::search_by_title() expected to be a reference, value given in .../wp-includes/class-wp-hook.php on line 303

    The field array used to generate the meta-box is as follows:

    array (
        'id' => $prefix . 'venue',
        'type' => 'post',
        'name' => 'Venues',
        'class' => 'venue_live',
        'std' => '',
        'required' => 1,
        'post_type' => 'venue',
        'field_type' => 'select_advanced',
        'query_args' => array(
            'author' => SELF::get_current_user_id(),
        ),
        'multiple' => true,
        'placeholder' => 'Select Venue(s)'
    ),

    The problem persists when the filed array is reduced to:

    array (
        'id' => $prefix . 'venue',
        'type' => 'post',
        'post_type' => 'page',
        'name' => 'Venues',
    ),

    I will now dig into the WP search_by_title function and back trace the issue, but though I would post here to see if this is a known issue.

    #32603
    pluginovenpluginoven
    Participant

    Update:
    The issue appears to be coming from commit e5cb8b9

    #32605
    pluginovenpluginoven
    Participant

    Found the issue:
    fields/post.php line 181:
    public static function search_by_title( $search, &$wp_query ) {
    should be:
    public static function search_by_title( $search, $wp_query ) {
    remove the & symbol before the variable.
    Shall I submit a pull request?

    #32631
    Long NguyenLong Nguyen
    Moderator

    Hi,

    Thanks for your feedback.

    We've noticed this issue and it will be fixed as soon as possible.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.