• Hi,

    Thank you for this plugin. I have noticed a bug (I believe) where the $_REQUEST['_acf_post_id'] and $_REQUEST['acf'] are not checked if they exist when $fields->init(); is called.

    wp-content/plugins/calculated-fields-for-acf/src/Fields.php:35
    wp-content/plugins/calculated-fields-for-acf/src/Fields.php:36

    
    $postId       = isset( $_REQUEST[] ) sanitize_text_field( $_REQUEST['_acf_post_id'] );
    $postedFields = (object) $_REQUEST['acf'];
    

    This is called via calculated_fields_update_value which is called by add_filter('acf/update_value', 'calculated_fields_update_value', 10, 3);

    I’ve working with ACF and it calls update_field in the edit.php page in custom columns that I’ve added. This triggers the above error when the filter is called.

    I noticed that postID is never used so could be deleted. And, I modified the second line to:

    $postedFields = isset( $_REQUEST['acf'] ) ? (object) $_REQUEST['acf'] : (object) [];

    I’m not sure if this is the perfect fix. Appreciate if you could look into this.

  • The topic ‘Undefined index: _acf_post_id’ is closed to new replies.