• Resolved screamingdev

    (@screamingdev)


    Had to do this

    <?php
    
    add_filter(
    	'acf/update_value',
    	static function ( $value, $post_id, $field ) {
    		if ( 'post_object' !== $field['type'] || 0 !== $field['multiple'] ) {
    			return $value;
    		}
    
    		if ( is_array( $value ) || 1 === count( $value ) ) {
    			return current( $value );
    		}
    
    		return $value;
    	},
    	10,
    	3
    );
    

    Because srv/wp-content/plugins/acf-extended/includes/fields-settings/bidirectional.php:520 in acfe_bidirectional_relationship stores the bidirectional value as an array.
    Even when no multiple values are allowed.

    This leads to a serialized value for meta_value in the database.

    Due to the serialized value get_post('meta_key=foo&meta_key=345') can’t find a thing. This is what your plugin breaks – hoping for a fix soon.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Konrad Chmielewski

    (@hwk-fr)

    Hello,

    I just check and yeah you are right about the Post Object & User relation fields. When you disable the “Allow multiple values” field setting, the data is directly saved without serilization.

    I’ll add a fix into the next patch!

    Thanks for the report ??

    Regards.

    Plugin Author Konrad Chmielewski

    (@hwk-fr)

    Hello,

    The new ACF Extended 0.7.9.9 update is available as pre-release on Github (soon on the WP repository): https://github.com/acf-extended/ACF-Extended

    It includes the fix for your report ??

    Havce a nice day!

    Regards.

    Plugin Author Konrad Chmielewski

    (@hwk-fr)

    Hello,

    Just to let you know that the latest ACF Extended 0.7.9.9.8 version fix this problem. You can download it from the official WP Repository.

    Thanks again for the report!

    Regards.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘acfe_bidirectional_relationship breaks get_posts by meta value’ is closed to new replies.