Closed (cannot reproduce)
Project:
Bluecheese
Component:
Miscellaneous
Priority:
Minor
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
2 Apr 2006 at 09:23 UTC
Updated:
21 Aug 2014 at 21:00 UTC
Jump to comment: Most recent
When comments are posted using either of the 3 standard content types (filtered HTML, full HTML, PHP), an extra "p" element is wrapped around the comment, making it invalid HTML, as "p" elements cannot be nested.
The problem also applies to issues, just like it applies to their comments.
It does not apply to previews, for either issues or comments, only to their rendition once submitted.
It appears to be theme-independent. As of today, it is present on drupal.org itself.
It does not seem to apply to other node types, so it seems to be located somewhere within project.
Comments
Comment #1
dwwyup, the project module's code is full of hard-coded <p> elements. :( someone who knows more about CSS than i should probably fix all this so that the resulting output still looks reasonable once we rip all those out...
Comment #2
dwwNot sure when this was changed, but this no longer seems to be happening. fgm, if you notice this is still a problem, please re-open. Thanks.
Comment #3
fgmThis particular invalidity cause (nested P elements) has apparently been removed in the meantime, but another exists: taking for example this very page on d.o., for unlogged-in users, it is still invalid for two reasons:
<div class="links">» <a href="/"><a href="/user/login?destination=project/comments/add/56944">Login</a> or <a href="/user/register?destination=project/comments/add/56944">register</a> to follow up</a></div>, which is invalid because of nested A elements in the "Follow up" link, which seems to be part ofproject_issue_link, although I don't see howComment #4
hunmonk commentedcan't locate the issue you refer to. i'm guessing that it was fixed already. marking to be ported if anybody cares to fix this.
Comment #5
fgmHunmonk,
Just look at : http://validator.w3.org/check?uri=http%3A%2F%2Fdrupal.org%2Fnode%2F56944...
as of today, the invalid HTML is still being generated for the same errors with the version currently running on d.o. (although I don't know which one it is).
Comment #6
hunmonk commented@fgm: please feel free to submit a patch to correct this -- it's doubtful it will be addressed any time soon unless you do. :)
Comment #7
fgmIt's rather difficult to guess without being able to test on the site itself, but I looks rather like a case of
hook_link_altersomewhere on the site adding<a href"/">to the link inproject_issue_link, which already includes a<a href="[...]returned fromtheme_project_issue_follow_up_forbidden.In such a case,
theme_links, as invoked fromnode_view, will generate the extraneous<a href="/">causing this error.But without access to the actual d.o. code, it's hard to tell.
Comment #8
dwwWith very few exceptions, d.o runs the HEAD of project*. I'm pretty sure this is just a trivial, silly bug if someone looked closely at those login-or-register links and where they're coming from.
Comment #9
john morahan commentedThe same thing is happening on e.g. the forum pages on d.o, with the "Login or register to post comments" link.
Is it possible that bluebeach is overriding theme_links, but not changing the
<a>to<span>when $link['href'] is unset?Comment #10
hunmonk commented@dww: i've looked at the project issue code for the generation of those links, and see no issues.
i've tried to reproduce this problem on a local install with the garland theme, and no luck.
since john is reporting this same problem with links generated from other modules, i'd conclude that the next most likely place to check is, in fact, bluebeach. reassigning.
Comment #11
fgmYup, I've identified the problem thanks to a fragment of bluebeach killes pasted me. the culprit appears to be
function phptemplate_links($links), which indiscriminately invokesl($link['title'], $link['href'] ...without checking whether a href attribute exists or not.And since
l()does not allow non-linking A elements, it builds a link to the home page, causing what we see.The obvious solution is to check whether such an attribute exists and invoke
lor not depending on whether the attribute is present or not.The arguably better solution would be to allow
l()to work without ahrefattribute, but IIRC the last time I suggested this, it was rejected on backwards compatibility grounds.Comment #12
fgmThis should fix the problem. However, I don't have access to bluebeach so can't generate a patch or test.
This test is actually lifted from API sample for D5
theme_links.Comment #13
fgmForgot to set status
Comment #14
john morahan commentedComment #15
fgmwhoops, you're right, I missed the line building $html when pasting.
Comment #16
killes@www.drop.org commentedWhat to do with this? Still valid?
Comment #17
fgmIssue still present, try the link on http://drupal.org/node/56944#comment-392973
Since bluebeach is not public, I can't test the patch on the current version.
Comment #18
drummComment #19
drummThis should be fixed in SVN trunk and 5.
If you want to help out with bluebeach, see http://groups.drupal.org/drupalorg-theme-developers
Comment #20
fgmIf SVN trunk and 5 is what's currently on d.o., the problem is not fixed.
However, not being a member of the infra team, I don't have SVN access to test it elsewhere: these apparently don't have the same accounts as CVS.
Comment #21
drummIt was committed, but not deployed yet. It is now running live on scratch.drupal.org.
Comment #22
fgmThen it does not completely fix the issue: the same problem is present on scratch.drupal.org with still 16 errors, in comparison with 61 errors on drupal.org for the same page.
Check http://validator.w3.org/check?uri=http%3A%2F%2Fscratch.drupal.org%2Fnode...
Comment #23
Graeme Blackwood commentedI am closing this as I'm pretty sure it is fixed. I am not getting any validation errors and we are now on a totally different theme.