Support » Plugin: WC Fields Factory » Notice: id was called incorrectly

  • Resolved carver1g

    (@carver1g)


    Have just updated to woocommerce 3.0 and am getting the following notice:

    Notice: id was called incorrectly. Product properties should not be accessed directly. Please see Debugging in WordPress for more information. (This message was added in version 3.0.) in C:\server\site\wordpress\wp-includes\functions.php on line 4137

    Any help appreciated

Viewing 2 replies - 1 through 2 (of 2 total)
  • Solved the notice ” id was called incorrectly” by opening wcff-product-form.php in notepad++ and changing
    lines 91 and 92:

    change $product->id to $product->get_id()

    I should have looked here before I am trying it myself.
    Anyway, here is a proper diff

    --- wcff-product-form.org.php   2017-04-07 09:00:23.363125405 +0200
    +++ wcff-product-form.php       2017-04-07 09:00:28.739083864 +0200
    @@ -88,8 +88,8 @@
                            $fields_group_title = "Additional Options : ";
                    }
    
    -               $all_fields = apply_filters( 'wcff/load/all_fields', $product->id, 'wccpf' );
    -               $admin_fields = apply_filters( 'wcff/load/all_fields', $product->id, 'wccaf', 'any' );
    +               $all_fields = apply_filters( 'wcff/load/all_fields', $product->get_id(), 'wccpf' );
    +               $admin_fields = apply_filters( 'wcff/load/all_fields', $product->get_id(), 'wccaf', 'any' );
    
                    foreach ( $all_fields as $title => $fields ) {
                            if( count( $fields ) > 0 ) {
    • This reply was modified 3 years, 6 months ago by ole1986.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Notice: id was called incorrectly’ is closed to new replies.