The HTML fragment causing the error: Remaining 1 of 1.<br/>&nbsp

Error: not well-formed
Source File: 
Line: 1, Column: 70
Source Code:
<div xmlns="http://www.w3.org/1999/xhtml">Remaining 1 of 1.<br/>&nbsp</
Error: uncaught exception: [Exception... "Component returned failure code: 0x80004003 (NS_ERROR_INVALID_POINTER) [nsIDOMNSHTMLElement.innerHTML]"  nsresult: "0x80004003 (NS_ERROR_INVALID_POINTER)"  location: "JS frame :: http://www.cceldev.org/files/js/js_ab394fffda2e6754ef32ce7bbe99741f.js :: anonymous :: line 13"  data: no]

I'm attaching a patch as soon as I know the bug number.

CommentFileSizeAuthor
#1 drupal-1093352.patch824 bytesohnobinki

Comments

ohnobinki’s picture

Status: Active » Needs review
StatusFileSize
new824 bytes

Status: Needs review » Needs work

The last submitted patch, drupal-1093352.patch, failed testing.

rfay’s picture

Component: ajax system » base system

Please describe how you get this error. Completely. We need to be able to understand exactly what's going on to even understand what you're up against.

Changing this to "base system". AJAX is certainly not the place for it.

ohnobinki’s picture

Assigned: ohnobinki » Unassigned
Status: Needs work » Needs review

@rfay I asked my browser to respect XHTML as XML/XHTML. I do this by actually sending out Content-Type: application/xhtml+xml; encoding=utf-8 if the browser's Accept: header suggests it will eat XHTML. This means that when the browser is fed ``&nbsp'' instead of `` '' by the JSON response during a batch process, such as rebuilding node access permissions when using stuff like og_access, a DOM/javascript error will get thrown which stops the batch process dead in its tracks.

I consider this a problem with drupal's AJAX system because the HTML is being introduced by an AJAX mechanism -- the batch processing code.

I do not understand why a patch to simply fix an an HTML entity requires so much consideration. Drupal should not rely on HTML's glossing over of HTML syntax errors such as this. Also, there is nowhere else in Drupal's code where the invalidly-formatted HTML entity can be fixed, so no other patch than this or to completely replace the entity with an XML compatible entity such as   or to just replace it with the UTF-8 non-breaking-space character should be done instead. If you want the patch to do that instead, I can reroll it. Otherwise, I am resetting this bug to needs review because the patch or its equivalent needs to be committed...

ohnobinki’s picture

#1: drupal-1093352.patch queued for re-testing.

rfay’s picture

Testing of 6.x core patches is not currently working, unfortunately, so the test will fail.

I believe that if your analysis is correct this will have to be fixed in 7.x and 8.x first, but I'm not sure what the consensus is on that at this time.

Could you please test this in 7.x?

Status: Needs review » Needs work

The last submitted patch, drupal-1093352.patch, failed testing.

ohnobinki’s picture

Status: Needs work » Needs review

I have tested and confirmed that this bug is not present in drupal-7.x nor drupal-8.x. That is why I started the bug out targeting drupal-6.x ;-).

Also, I understand that the consensus on XHTML support is not favorable to me messing with my Content-Type:. However, I think that even HTML proponents would likely support fixing silly little things like &nbsp versus &nbsp;.

And thanks for the explanation about the tests. I looked at the log and was pretty sure that being unable to clone the repository properly wasn't my fault — but I don't know the testing system that well.

rfay’s picture

Well, you have my support. Looks like a no-brainer.

markabur’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to me. I haven't tested it but it's a simple, obvious fix of a silly typo.

markabur’s picture

Version: 6.20 » 6.x-dev

Patch does apply cleanly to 6.x (using -p1)

gábor hojtsy’s picture

Status: Reviewed & tested by the community » Fixed

Thanks, committed and pushed.

Status: Fixed » Closed (fixed)
Issue tags: -xhtml compliance

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