When you a(n anonymous) user isn't permitted to comment, Drupal would show the link 'Login or register to post comments' below every comment. Login and register are both linking to their respective pages.
The links in this string are transformed to html entities by Drupal. This shows the links as a literal string rather then a true hyperlink in the users' webbrowser.
I've tracked the issue down to a missing html attribute boolean in the $links array which is generated by comment_links().
I couldn't find an issue that already reports this problem, so this is it.
I've attached two files:
1. screenshot of the issue
2. a patch which solves the issue
Anyone else seeing this?
Comment | File | Size | Author |
---|---|---|---|
#21 | 439148-5.patch | 4.38 KB | catch |
#18 | 439148-5.patch | 4.38 KB | pp |
#13 | 439148_4.patch | 4.6 KB | tobiasb |
#9 | 439148-3.patch | 4.38 KB | pp |
#8 | 439148-2.patch | 4.33 KB | pp |
Comments
Comment #1
Anonymous (not verified) CreditAttribution: Anonymous commentedComment #2
mcrittenden CreditAttribution: mcrittenden commentedSo how can I reproduce the error? Something like:
That right?
Comment #3
netsensei CreditAttribution: netsensei commentedYes, that's right.
Comment #4
pp CreditAttribution: pp commentedFirst of all. I see this patch, its good.
If you want to test it do the followings:
1. install the Drupal
2. add one new Article
3. add one or two comments to this article.
4. add "Access comments" permission to Anonymous user
5. log out
You see the problem when you see the article(node/1).
The patch resolve the bug.
Comment #5
robomalo CreditAttribution: robomalo commentedThis also worked for me.
Comment #6
mcrittenden CreditAttribution: mcrittenden commentedWorks for me also. Nice, simple patch. Let's get it in.
Comment #7
pp CreditAttribution: pp commentedI added the test to it. Test is not good, I'am working on it.
Comment #8
pp CreditAttribution: pp commentedHere is the corrected patch.
Comment #9
pp CreditAttribution: pp commentedAdd little typo.
Comment #10
xmacinfoWill this patch also correct this issue : #438224: "Post comments without approval" permission name is completely misleading? Or do we need to tackle one issue before the other?
Comment #11
xmacinfoBy the way, I was able to resolve this issue by deleting both D7 install and the database and reinstall from a fresh CVS copy. After that, the login/register link was perfectly displayed.
Did you try to reinstall D7 and the database completly before doing this patch?
Comment #12
xmacinfoEdited to erase this comment.
Comment #13
tobiasbreroll (http://drupal.org/cvs?commit=202766)
Comment #14
xmacinfoI think this patch is obsolete. See me comment in #11. :-)
Comment #15
pp CreditAttribution: pp commentedDid you read my comment #4 and see the picture? Did you add two comment to a node? Did you set Access comments permissions?
In this moment I get a fress CVS copy of Drupal, drop database, set permission Access comments and make all steps which in my comment #4 and bug is present.
pp
Comment #16
xmacinfoThanks! Now I duplicated this error laud and clear. I'll try to review it later, unless someone beats me to it.
Comment #18
pp CreditAttribution: pp commentedReroll
Comment #19
xmacinfoI made sure I was able to reproduce the problem again. :-)
I've applied the patch and I can report that it corrects the error and that the text and links are displayed properly. From my point of view it's RTBC.
Comment #20
mcrittenden CreditAttribution: mcrittenden commentedLooks good from my end as well.
Comment #21
catchFixed up some phpdoc in the code comments, otherwise this is still RTBC. Since it's one line of real code and comes with tests, marking quick fix too.
Comment #22
Dries CreditAttribution: Dries commentedI committed #470866: Comment links should use 'html' => TRUE -- this one might require a reroll. Let's ask the test bot ...
Comment #23
webchickThe first hunk looks like it was committed as part of #470866: Comment links should use 'html' => TRUE, but it's nice to have test coverage for this. So committed the comment.test part to HEAD.
Thanks a bunch!!