• Resolved Geoffrey

    (@geoffrey1963)


    Hi, I need to upgrade my website to PHP 7.4.10 yesterday as my website was throwing error messages when adding items to the cart. Now when I go to print PDF invoices I am getting this error message…
    Fatal error: Call to undefined function WPO\WC\PDF_Invoices\Documents\ctype_digit()
    #0 /hermes/bosnacweb05/bosnacweb05ag/b2831/nf.thenuthouse1/public_html/wp-content/plugins/woocommerce-pdf-invoices-packing-slips/includes/documents/class-wcpdf-document-number.php(77): WPO\WC\PDF_Invoices\Documents\Document_Number->apply_formatting(Object(WPO\WC\PDF_Invoices\Documents\Invoice), Object(Automattic\WooCommerce\Admin\Overrides\Order))
    #1 /hermes/bosnacweb05/bosnacweb05ag/b2831/nf.thenuthouse1/public_html/wp-content/plugins/woocommerce-pdf-invoices-packing-slips/includes/documents/abstract-wcpdf-order-document.php(495): WPO\WC\PDF_Invoices\Documents\Document_Number->__construct(836, Array, Object(WPO\WC\PDF_Invoices\Documents\Invoice), Object(Automattic\WooCommerce\Admin\Overrides\Order))
    #2 /hermes/bosnacweb05/bosnacweb05ag/b2831/nf.thenuthouse1/public_html/wp-content/plugins/woocommerce-pdf-invoices-packing-slips/includes/documents/class-wcpdf-invoice.php(122): WPO\WC\PDF_Invoices\Documents\Order_Document->set_number(836)
    #3 /hermes/bosnacweb05/bosnacweb05ag/b2831/nf.thenuthouse1/public_html/wp-content/plugins/woocommerce-pdf-invoices-packing-slips/includes/documents/class-wcpdf-invoice.php(74): WPO\WC\PDF_Invoices\Documents\Invoice->init_number()
    #4 /hermes/bosnacweb05/bosnacweb05ag/b2831/nf.thenuthouse1/public_html/wp-content/plugins/woocommerce-pdf-invoices-packing-slips/includes/wcpdf-functions.php(89): WPO\WC\PDF_Invoices\Documents\Invoice->init()
    #5 /hermes/bosnacweb05/bosnacweb05ag/b2831/nf.thenuthouse1/public_html/wp-content/plugins/woocommerce-pdf-invoices-packing-slips/includes/class-wcpdf-main.php(323): wcpdf_get_document(‘invoice’, Object(Automattic\WooCommerce\Admin\Overrides\Order), true)
    #6 /hermes/bosnacweb05/bosnacweb05ag/b2831/nf.thenuthouse1/public_html/wp-includes/class-wp-hook.php(287): WPO\WC\PDF_Invoices\Main->generate_pdf_ajax(”)
    #7 /hermes/bosnacweb05/bosnacweb05ag/b2831/nf.thenuthouse1/public_html/wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters(”, Array)
    #8 /hermes/bosnacweb05/bosnacweb05ag/b2831/nf.thenuthouse1/public_html/wp-includes/plugin.php(478): WP_Hook->do_action(Array)
    #9 /hermes/bosnacweb05/bosnacweb05ag/b2831/nf.thenuthouse1/public_html/wp-admin/admin-ajax.php(176): do_action(‘wp_ajax_generat…’)
    #10 {main}

    I’m not really tech orientated, so at the moment i’m stuck and cant print invoices at all. Hope you are able to help. This error message has only appeared since upgrade to PHP 7.4.10 yesterday evening.
    I am using Woocommerce PDF invoices version 2.7.1, and Woocommerce 4.7.0.

    Regards
    Geoff

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Contributor Ewout

    (@pomegranate)

    Hi! I’m sorry to hear that. The error tells us that the plugin can’t find the ctype_digit function, which is normally included in standard PHP installations (no difference for PHP7.4), see: https://www.php.net/manual/en/function.ctype-digit.php

    Is it possible that your version of PHP7.4 was not installed completely? Did you install the upgrade yourself?

    I will add some extra checks to our plugin to prevent this crash from happening, though that will not solve your issue completely so it would be good to find the root cause.

    Thread Starter Geoffrey

    (@geoffrey1963)

    Hi and thanks for your speedy reply!
    I contacted my web host yesterday as I was getting errors adding items to cart and they said that the Woocommerce plugin was the cause, so I upgraded the PHP version and this solved that problem, now ive got this playing up. I am able to install the PHP version myself through their control panel. Should I go back and retry the installation, if that makes sense, or should I speak to them about this.?

    Thanks
    Geoff

    • This reply was modified 4 years, 4 months ago by Geoffrey.
    Plugin Contributor Ewout

    (@pomegranate)

    I would recommend contacting the host first, telling them that ctype_digit appears to be missing from your PHP7.4 installation. That’s quite unusual.

    Thread Starter Geoffrey

    (@geoffrey1963)

    Thanks…I will get onto them right now. They are quick to respond so hopefully I get an answer asap, right on xmas and I dont really want this, so I will get back to you when I find the answer.
    thanks again

    Geoff

    Thread Starter Geoffrey

    (@geoffrey1963)

    Hi again, I have been on chat for almost 2hrs and finally an outcome. It appears the php version does not have that ctype_digit function, and the technicians are now working on it. Thanks for your input as it has made it much easier for me to talk to them about the problem.

    Thanks
    Geoff
    PS The plugin works flawlessly on PHP 7.3, but not 7.4

    Plugin Contributor Ewout

    (@pomegranate)

    Hello Geoff,
    The ctype_digit function is usually part of the default 7.4 installation (many of our users have been using 7.4 for a long time already without issues), it’s part of the Ctype extension: https://www.php.net/manual/en/intro.ctype.php
    They only need to enable that extension and you should be good.

    We’re releasing an update today that removes the dependency on that function, but I would still recommend asking them to install this and any other common PHP extensions (check the “Status” tab of the PDF invoice settings for further recommendations)

    Thread Starter Geoffrey

    (@geoffrey1963)

    Hello Ewout,
    Yes I am not sure why they hadn’t installed this function, however they are now in the process of doing this. If they had done it right from the start I would not have experienced these issues to start with. I will look forward to your update later today and thanks again for all your assistance regarding this.
    Thanks
    Geoff
    PS I have updated to new version plugin this morning – thank you

    • This reply was modified 4 years, 4 months ago by Geoffrey.
Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Errors after upgrade PHP to 7.4.10’ is closed to new replies.