• Resolved arturs4

    (@arturs4)


    Hello!

    PDF invoices – General gives me this error:

    Error trying to generate document: Typed property DOMDocument::$documentElement must not be accessed before initialization

    When I try to generate PDF invoice in “edit order” page, i get this error:

    example.com/wp-content/plugins/woocommerce-pdf-invoices-packing-slips/vendor/masterminds/html5/src/HTML5/Parser/DOMTreeBuilder.php (275) 0 example.com/wp-content/plugins/woocommerce-pdf-invoices-packing-slips/vendor/masterminds/html5/src/HTML5/Parser/Tokenizer.php(402): Masterminds\HTML5\Parser\DOMTreeBuilder->startTag() 1 example.com/wp-content/plugins/woocommerce-pdf-invoices-packing-slips/vendor/masterminds/html5/src/HTML5/Parser/Tokenizer.php(144): Masterminds\HTML5\Parser\Tokenizer->tagName() 2 example.com/wp-content/plugins/woocommerce-pdf-invoices-packing-slips/vendor/masterminds/html5/src/HTML5/Parser/Tokenizer.php(82): Masterminds\HTML5\Parser\Tokenizer->consumeData() 3 example.com/wp-content/plugins/woocommerce-pdf-invoices-packing-slips/vendor/masterminds/html5/src/HTML5.php(161): Masterminds\HTML5\Parser\Tokenizer->parse() 4 example.com/wp-content/plugins/woocommerce-pdf-invoices-packing-slips/vendor/masterminds/html5/src/HTML5.php(89): Masterminds\HTML5->parse() 5 example.com/wp-content/plugins/woocommerce-pdf-invoices-packing-slips/vendor/dompdf/dompdf/src/Dompdf.php(478): Masterminds\HTML5->loadHTML() 6 example.com/wp-content/plugins/woocommerce-pdf-invoices-packing-slips/includes/makers/class-pdf-maker.php(50): Dompdf\Dompdf->loadHtml() 7 example.com/wp-content/plugins/woocommerce-pdf-invoices-packing-slips/includes/documents/abstract-wcpdf-order-document.php(906): WPO\WC\PDF_Invoices\Makers\PDF_Maker->output() 8 example.com/wp-content/plugins/woocommerce-pdf-invoices-packing-slips/includes/documents/abstract-wcpdf-order-document.php(972): WPO\WC\PDF_Invoices\Documents\Order_Document->get_pdf() 9 example.com/wp-content/plugins/woocommerce-pdf-invoices-packing-slips/includes/class-wcpdf-main.php(519): WPO\WC\PDF_Invoices\Documents\Order_Document->output_pdf() 10 example.com/wp-includes/class-wp-hook.php(324): WPO\WC\PDF_Invoices\Main->generate_document_ajax() 11 example.com/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters() 12 example.com/wp-includes/plugin.php(517): WP_Hook->do_action() 13 example.com/wp-admin/admin-ajax.php(188): do_action() 14 {main}

    I disabled all plugins, but that didnt help.

    PDF – Advanced – Status gives me all green settings (except yearly reset).

    Do you have any ideas how to fix it?

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Contributor dwpriv

    (@dwpriv)

    Are you using a custom template? Also, could you share a screenshot of your config settings under PDF Invoices > Advanced > Status, please?

    Thread Starter arturs4

    (@arturs4)

    Yes, custom template, which is based on your template SIMPLE.

    Screenshot: https://ibb.co/pw9Db34

    Thread Starter arturs4

    (@arturs4)

    I switched template to default, but that didnt help.

    Plugin Contributor Darren Peyou

    (@dpeyou)

    @arturs4,

    What version of the plugin are you using?

    > I switched template to default, but that didn’t help.
    – Have you modified the plugin’s core files in any way? The error message is mentioning that something is getting initialized too early.
    – Do you have any active code snippets?

    Thread Starter arturs4

    (@arturs4)

    Im using Version 3.7.2.

    I tried to rollback to some earlier versions up to 3.5.0, but that didnt help.

    I havent modified plugin files, just the template file which sits in child themes folder. But i have tried to switch to default theme, that doesnt help.

    I removed all my custom code from functions.php, but that didnt help either.

    Any ideas?

    Thread Starter arturs4

    (@arturs4)

    I switched to Twenty Twenty-Four theme, disabled all plugins except PDF invoice and woo, pdf template is set to default (Simple). The problem is still there.

    Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    @alexmigf Why exactly are you asking for off forum contact? Please be completely truthful.

    What are you going to ask for that you cannot ask here?

    Plugin Contributor alexmigf

    (@alexmigf)

    @jdembowski sorry for not being clear enough.

    I just don’t have a clue of what the issue is at this point, and that will require temporary access to debug. The issue points to a third party library that we load in our plugin, but I can’t replicate the issue locally, so the idea was to ask the user access to debug. Because that involves giving access, I thought it would be preferable to do it by email, security wise.

    I was expecting that using the default PDF template would fix the issue, because generally this type of errors happen on custom PDF templates, but the user said that keeps having the issue even using the default template, see here.

    What do you recommend me to do? Or how should I behave in this type of cases?

    Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    I just don’t have a clue of what the issue is at this point, and that will require temporary access to debug.

    Yes, and thank you for being honest and transparent. I really appreciated it.

    Please do not, that is explicitly not allowed with forum users.

    While I know you have the best of intentions, it’s forum policy that you not ask users for admin or server access. Users on the forums aren’t your customers, they’re your open source collaborators, and requesting that kind of access can put you and them at high risk.

    If they are paying customers (such as people who bought a premium service/product from you) then by all means, direct them to your official customer support system. But in all other cases, you need to help them here on the forums.

    Thankfully are other ways to get information you need:

    You get the idea.

    We know volunteer support is not easy, and this guideline can feel needlessly restrictive. It’s actually there to protect you as much as end users. Should their site be hacked or have any issues after you accessed it, you could be held legally liable for damages. In addition, it’s difficult for end users to know the difference between helpful developers and people with malicious intentions. Because of that, we rely on plugin developers and long-standing volunteers (like you) to help us and uphold this particular guideline.

    When you help users here and in public, you also help the next person with the same problem. They’ll be able to read the debugging and solution and educate themselves. That’s how we get the next generation of developers.

    Thread Starter arturs4

    (@arturs4)

    I have resolved my problem. It turns out that my previous php version 8.1.24 was in some way defective. I updated it to 8.2.11, and now the plugin works fine.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Fatal error: Typed property DOMDocument’ is closed to new replies.