Support » Plugin: Flexible PDF Invoices for WooCommerce & WordPress » FATAL ERROR upon saving

  • Resolved uomopalese

    (@uomopalese)


    Hi,
    I’m retriving a fatal error upon saving:

    Fatal error: Uncaught Error: Call to undefined function wc_clean() in /Users/me/Sites/fev/wp-content/plugins/flexible-invoices/class/invoicePost.php:513

    this is the line 513:

    $number = wc_clean( str_replace( $decimals, '.', $number ) );

    This is a workaround (removed wc_clean() wrapper):

    $number = str_replace( $decimals, '.', $number );

    I guess wc_clean() is for woocommerce, this is why is retrived as undefined function.

    Is this Plugin for woocommerce only?
    Regards.

    • This topic was modified 5 years, 12 months ago by uomopalese. Reason: corrections
Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi,

    WooCommerce is not necessary. The plugin works stand-alone. But wc_clean is instead for WooCommerce. Do you use the latest version of the plugin?

    Thread Starter uomopalese

    (@uomopalese)

    Hi,
    thanks for replay.
    Yes, I’m using last version (3.4.6) with Genesis Theme, all other plugins deactivated, Woocommerce not installed at all.
    Here’s the complete stack:

    Fatal error: Uncaught Error: Call to undefined function wc_clean() in /Users/gio/Sites/genesis/wp-content/plugins/flexible-invoices/class/invoicePost.php:513 
    Stack trace: 
    #0 /Users/me/Sites/genesis/wp-content/plugins/flexible-invoices/class/invoicePost.php(534): InvoicePost->format_decimal('1') 
    #1 /Users/me/Sites/genesis/wp-content/plugins/flexible-invoices/class/invoicePostType.php(917): InvoicePost->setProductsFromPostArray(Array) 
    #2 /Users/me/Sites/genesis/wp-includes/class-wp-hook.php(300): invoicePostType->saveCustomFieldsAction(17075, Object(WP_Post)) 
    #3 /Users/me/Sites/genesis/wp-includes/class-wp-hook.php(323): WP_Hook->apply_filters('', Array) 
    #4 /Users/me/Sites/genesis/wp-includes/plugin.php(453): WP_Hook->do_action(Array) 
    #5 /Users/me/Sites/genesis/wp-includes/post.php(3505): do_action('save_post', 17075, Object(WP_Post), true) 
    #6 /Users/me/Sites/genesis/wp-includes/post.php(3578): wp_insert_post(Array, false) 
    #7 /Users/me/Sites/genesis/wp-admin/includes/post.php(378): wp_update_post(Array) 
    #8 /Users/me in /Users/me/Sites/genesis/wp-content/plugins/flexible-invoices/class/invoicePost.php on line 513

    Regards
    Gio

    Thread Starter uomopalese

    (@uomopalese)

    Hi,
    any update on this?
    please check this link

    https://dl.dropboxusercontent.com/u/41344268/error.jpg

    Regards

    Gio

    Hi again,

    I tested this issue. I got 500 error trying to save an invoice. It works when I have WooCommerce installed. It should work stand-alone but as I see it doesn’t. Could you please check if it works with WooCommerce for you? If so, I will report a bug.

    Thread Starter uomopalese

    (@uomopalese)

    Hi,
    no error with Woocommerce installed.
    BTW the plugin works fine if you comment line 513

    // $number = wc_clean( str_replace( $decimals, '.', $number ) );

    Cheers
    Gio

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘FATAL ERROR upon saving’ is closed to new replies.