Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#8 | print-2349121-8-fix-php-DOM-warning.patch | 492 bytes | mikeytown2 |
Comments
Comment #1
dadderley CreditAttribution: dadderley commentedThis error is showing up in 7.x-1.3 as well. This just started to happen.
Comment #2
mikefyfer CreditAttribution: mikefyfer commentedAlso showing up for me, seemingly randomly.
Print 7.x-2.0
DOMPDF 0.6.1
Comment #3
dadderley CreditAttribution: dadderley as a volunteer commentedThe error happens every time a pdf is created.
Does anybody have an idea why this is happening?
Comment #4
dadderley CreditAttribution: dadderley as a volunteer commentedMy particular problem seems to be a conflict with the Advanced CSS/JS Aggregation module.On further investigation, this is not the case.
Comment #5
mikeytown2 CreditAttribution: mikeytown2 commentedhttp://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.
Comment #6
dadderley CreditAttribution: dadderley as a volunteer commentedThanks 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.
Comment #7
Vako CreditAttribution: Vako commentedSo 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??
Comment #8
mikeytown2 CreditAttribution: mikeytown2 commentedFix is in this module. Patch should do it.
Comment #9
Vako CreditAttribution: Vako commentedThank 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.
Comment #10
mikeytown2 CreditAttribution: mikeytown2 commentedThat's all you need. Silence all the errors that come from libxml.
Comment #11
Vako CreditAttribution: Vako commentedSo far it's working for me.
Comment #12
mikeytown2 CreditAttribution: mikeytown2 commentedComment #16
jcnventura CreditAttribution: jcnventura commentedThanks @mikeytown2