Randomly we get the following message when we try to generate a PDF of the page:

Warning: DOMNode::cloneNode() [domnode.clonenode]: ID node-8 already defined in Frame_Decorator->split() (line 573 of /public_html/sites/all/libraries/dompdf-0.6.1/include/frame_decorator.cls.php)

We tried it with FireFox, Chrome and IE with the same results.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dadderley’s picture

This error is showing up in 7.x-1.3 as well. This just started to happen.

mikefyfer’s picture

Also showing up for me, seemingly randomly.

Print 7.x-2.0
DOMPDF 0.6.1

dadderley’s picture

Version: 7.x-2.x-dev » 7.x-2.0
Priority: Normal » Major

The error happens every time a pdf is created.
Does anybody have an idea why this is happening?

dadderley’s picture

My particular problem seems to be a conflict with the Advanced CSS/JS Aggregation module.
On further investigation, this is not the case.

mikeytown2’s picture

http://php.net/libxml-use-internal-errors & http://php.net/libxml-clear-errors could be used to ignore the warnings here; having multiple html ID's isn't the end of the world and that's why PDFs look fine in this case.

dadderley’s picture

Thanks for looking at it mikeytown2.

I have a site with thousands of nodes each of which can be converted to a PDF. Each time a spider bot hits the site I get thousands of of these errors. This is despite having all of the pdf links having rel="nofollow".

I tried using the TCPDF library to create PDFs. It does not produce PHP errors.
But he Dompdf library produces a much nicer PDF.

I am sure that you are correct when you say "having multiple html ID's isn't the end of the world" but it does produce the error.
It would be cool if these errors were suppressed by adding your fix.

Vako’s picture

So what's the verdict? is it the domPDF or the module causing this issue? it's putting so much stress on my server and the errors are so many that I had to disable this feature from my sites. I don't know how it's working for others...surely they have the same issue but don't care perhaps??

mikeytown2’s picture

Version: 7.x-2.0 » 7.x-2.x-dev
Status: Active » Needs review
FileSize
492 bytes

Fix is in this module. Patch should do it.

Vako’s picture

Thank you for the super fast reply ;)
I see the only line added is libxml_use_internal_errors(TRUE); right?

I will try the patch and report, hopefully it will be committed in the main module.

mikeytown2’s picture

That's all you need. Silence all the errors that come from libxml.

Vako’s picture

So far it's working for me.

mikeytown2’s picture

Status: Needs review » Reviewed & tested by the community

  • jcnventura committed d21803f on 7.x-2.x
    Issue #2349121 by mikeytown2, jcnventura: Avoid DOMNode::cloneNode()...
jcnventura’s picture

Status: Reviewed & tested by the community » Fixed

Thanks @mikeytown2

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.