• Resolved Janke

    (@soldier99)


    Hi,

    After upgrading to the latest version i have either blank page or error “No block-level parent found. Not good”

    Debug output shows this:

    Fatal error: Uncaught exception ‘Dompdf\Exception’ with message ‘No block-level parent found. Not good.’ in /public_html/wp-content/plugins/woocommerce-pdf-invoices-packing-slips/vendor/dompdf/dompdf/src/Positioner/Inline.php:45 Stack trace: #0 /public_html/wp-content/plugins/woocommerce-pdf-invoices-packing-slips/vendor/dompdf/dompdf/src/FrameDecorator/AbstractFrameDecorator.php(872): Dompdf\Positioner\Inline->position(Object(Dompdf\FrameDecorator\Text)) #1 /public_html/wp-content/plugins/woocommerce-pdf-invoices-packing-slips/vendor/dompdf/dompdf/src/FrameReflower/Text.php(368): Dompdf\FrameDecorator\AbstractFrameDecorator->position() #2 /public_html/wp-content/plugins/woocommerce-pdf-invoices-packing-slips/vendor/dompdf/dompdf/src/FrameDecorator/AbstractFrameDecorator.php(893): Dompdf\FrameReflower\Text->reflow(NULL) #3 /public_html/wp-content/plugins in /public_html/wp-content/plugins/woocommerce-pdf-invoices-packing-slips/vendor/dompdf/dompdf/src/Positioner/Inline.php on line 45

    What i have tried so far:
    1. Deactivated all plugins except Woocommerce and PDF Incvoices and packing slips.
    2. Switched to Twenty twelve theme
    3. Reinstalled fonts
    4. Removed temporary files
    5. Deleted legacy 1x settings
    6. Deleted plugin and then reinstalled it

    Nothing above worked.

    WP memory is 128M and no orange or red flags are shown. We use only Simple template and we have not midified it.

    Please advise how to fix this issue.

    Thanks,
    J.

    • This topic was modified 7 years, 6 months ago by Janke.
Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Contributor Ewout

    (@pomegranate)

    Hi! Thanks for reporting. This is a known issue in dompdf, related to a recent libxml update. More information here: https://github.com/dompdf/dompdf/issues/1494

    You can fix this by adding a small code snippet to your site:

    
    add_filter( 'wpo_wcpdf_dompdf_options', 'wpo_wcpdf_dompdf_options_custom', 10, 1 );
    function wpo_wcpdf_dompdf_options_custom($options) {
    	$options['isHtml5ParserEnabled'] = true;
    	return $options;
    }
    

    If you haven’t worked with code snippets (actions/filters) or functions.php before, read this guide: How to use filters.
    This requires today’s release of the PDF Invoice plugin (2.0.10)

    I will look into enabling this by default.

    Ewout

    Thread Starter Janke

    (@soldier99)

    Thank you for your quick reply. At first it did not work. Then i deleted the plugin and reinstalled and then it solved the problem.

    Thanks again.

    Delete this. I don’t see the delete button.

    There is a big problem, the plugin is not working anymore…
    Can somebody help him?

    The solution mentioned above is not working!

    Solution:
    https://github.com/dompdf/dompdf/issues/1494

    It’s a whitespace, told me.

    Plugin Contributor Ewout

    (@pomegranate)

    Hello Vincent,
    The solution from the github post above (to which I also linked in my reply here) is exactly what the filter accomplishes, it switches to the HTML5 parser to avoid the whitespace issue (whitespace causes the error but is itself the result of the parser used).
    This filter ONLY works with version 2.0.10 (or higher).

    Ewout

    I have still have this problem. I even added the fitler, but still the same error. any idea’s? I am using version 2.0.13.

    Plugin Contributor Ewout

    (@pomegranate)

    Hi! This filter is NOT required anymore, as version 2.0.11 or later (including current 2.0.13) enables the HTML5 parser by default (you can disable it via WooCommerce > PDF Invoices > Status, setting “Use DOMDocument to parse HTML”. What is the exact PHP error you’re getting?

    This is the state of WooCommerce > PDF Invoices > Status: https://imgur.com/a/tPZKR
    The error i get is “No block-level parent found. Not good.” where can i get the exact php error? i checked “Use DOMDocument to parse HTML”.

    Plugin Contributor Ewout

    (@pomegranate)

    I see, if you’re getting “No block-level parent found. Not good.”, you should uncheck the “Use DOMDocument to parse HTML”. That should prevent the “No block-level parent found. Not good.” error from happening.

    I still get the error. https://imgur.com/a/N5KSZ . “Op factuur” means on invoice.

    Plugin Contributor Ewout

    (@pomegranate)

    That is very strange – as far as I know this error only happens with the DOMDocument parser (in combination with a specific version of a php library: libxml 2.9.5 or later). I have seen reports where people had this issue even with the HTML5parser, but only with dompdf 0.8.1 and I still use 0.8.0 (for exactly this reason). Do you use any other plugins that create PDF documents that may be using dompdf?

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘“No block-level parent found. Not good” Error’ is closed to new replies.