DOMDocument::loadHTML() [domdocument.loadhtml]: Unexpected end tag : p in Entity, line: 13 in /home/www/servers/ap24/sites/all/modules/elf/elf.module on line 128.

CommentFileSizeAuthor
#2 sample.txt22.01 KBtroybthompson

Comments

xano’s picture

Status: Active » Postponed (maintainer needs more info)

Can you show what text you were trying to post?

troybthompson’s picture

StatusFileSize
new22.01 KB

I'm having the same problem. HTML attached. Using the 4/26 version.

bennos’s picture

this was just in the watchdog for a older node.

Have installed boost, and the node could be requested via boost.
will try it out, with a normal node request.

xano’s picture

I need a way to reproduce the error.

troybthompson’s picture

It looks like it's having issues with the line 26 in my upload with the CDATA slashes, etc at the beginning of the google analytics code in the header.

xano’s picture

Can you post some code to reproduce the error?

troybthompson’s picture

I'd be happy to post something if you can be more specific what you need. The full html of the page is in post #2 and the error is referencing line 26.

xano’s picture

I want to know what piece of code causes the error. An entire page isn't useful, because that isn't what you filled in for the node body.

troybthompson’s picture

Ok, I finally had time to do process of elimination on a test page to narrow down the problem. It happens when there's an ampersand inside the linked text (local, not external)

So the link "Special Offers & Coupons" gives the error:

* warning: DOMDocument::loadHTML() [domdocument.loadhtml]: htmlParseEntityRef: no name in Entity, line: 1 in /usr/www/users/cmcvb/sites/all/modules/elf/elf.module on line 128.
* warning: DOMDocument::loadHTML() [domdocument.loadhtml]: htmlParseEntityRef: no name in Entity, line: 1 in /usr/www/users/cmcvb/sites/all/modules/elf/elf.module on line 128.

but if I changed it to "Special Offers and Coupons" the error went away.

Does that help?

xano’s picture

Thanks! I think I know the reason for the error to pop up. However, this is another error than the one in the first post of this issue. I tried reproducing that by submitting invalid HTML, but I got no errors during that quick test.

xano’s picture

Title: Found following error in watchdog. » Errors due to invalid markup

The problem in #9 should no longer occur now that #787980: Encoding Issues is fixed. Can we focus here on errors due to invalid markup?

elally’s picture

subscribe

drupdruppalpal’s picture

same error:

warning: DOMDocument::loadHTML() [domdocument.loadhtml]: Unexpected end tag : p in Entity, line: 1 in /.../sites/all/modules/elf/elf.module on line 129.

i've already patched #787980: Encoding Issues but the error went away too

regards

skizzo’s picture

Version: 6.x-3.0-alpha1 » 6.x-3.x-dev

Adding a empty block to a views-generated page I don't see this error. As soon as I add

<A href="http://drupal.org">drupal</A>

to the block body (in content region) I get the following error

warning: DOMDocument::loadHTML() [domdocument.loadhtml]: Unexpected end tag : p in Entity, line: 2 in /var/www/drupal/sites/all/modules/elf/elf.module on line 129.

The block uses a custom input format which includes the following filters, in that order:
- URL filter
- Line break converter
- BBCode
- Collapse text
- Add an icon to external and mailto links
- HTML corrector

hedac’s picture

why is this module needing to perform a validation in html ?
I think it is not needed.. and generates warnings...
I got this today

* warning: DOMDocument::loadHTML(): AttValue: " expected in Entity, line: 1 in /home/wwwdrupal/sites/all/modules/elf/elf.module on line 129.
* warning: DOMDocument::loadHTML(): Couldn't find end of Start Tag img in Entity, line: 1 in /home/wwwdrupal/sites/all/modules/elf/elf.module on line 129.

matulis’s picture

Use @ to suppress warnings

@$document->loadHTML($html);
brad.bulger’s picture

Status: Postponed (maintainer needs more info) » Active

Contrary to #11, I am getting the same errors using 6.x-3.x-dev as described in #9. It doesn't seem like this is something that can be prevented, only hidden by suppressing errors as matulis suggests in #16, or maybe by using the libxml_use_internal_errors() function in some fashion. We've been avoiding upgrading this module from 2.1 because of just these kinds of problems, it still seems like the new approach is problematic.

specifics: loadHTML() of this text

<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/></head><body><div><a href="/cores">Search UCSF Research Core Facilities & Services</a></div></body>

causes the error DOMDocument::loadHTML(): htmlParseEntityRef: no name in Entity, line: 1

UPDATE: actually it does seem like suppressing the errors is probably the way, given that that's what Drupal 7.x Filter module is doing

mrded’s picture

@matulis Thank you :)

mrded’s picture

Version: 6.x-3.x-dev » 7.x-3.x-dev
Issue summary: View changes
WorldFallz’s picture

Status: Active » Fixed

As of #1261568: Incompatible with PHP versions below 5.3.6, the module is using the drupal wrapper function so this should no longer be an issue for 7.x. If anyone wants to submit a patch for 6.x-3.x please open a new issue.

Status: Fixed » Closed (fixed)

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