login/register link generated when a user isn't allowed to comment, is transformed to html entities
netsensei - April 20, 2009 - 13:13
| Project: | Drupal |
| Version: | 7.x-dev |
| Component: | comment.module |
| Category: | bug report |
| Priority: | normal |
| Assigned: | netsensei |
| Status: | closed |
| Issue tags: | Quick fix |
Description
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?
| Attachment | Size | Status | Test result | Operations |
|---|---|---|---|---|
| Picture 1.png | 44.05 KB | Ignored | None | None |
| comment-forbidden-entities.patch | 753 bytes | Idle | Failed: Failed to install HEAD. | View details |

#1
#2
So how can I reproduce the error? Something like:
That right?
#3
Yes, that's right.
#4
First 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.
#5
This also worked for me.
#6
Works for me also. Nice, simple patch. Let's get it in.
#7
I added the test to it. Test is not good, I'am working on it.
#8
Here is the corrected patch.
#9
Add little typo.
#10
Will this patch also correct this issue : #438224: "Post comments without approval" permission does not work by itself? Or do we need to tackle one issue before the other?
#11
By 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?
#12
Edited to erase this comment.
#13
reroll (http://drupal.org/cvs?commit=202766)
#14
I think this patch is obsolete. See me comment in #11. :-)
#15
Did 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
#16
Thanks! Now I duplicated this error laud and clear. I'll try to review it later, unless someone beats me to it.
#17
The last submitted patch failed testing.
#18
Reroll
#19
I 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.
#20
Looks good from my end as well.
#21
Fixed 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.
#22
I committed #470866: Comment links should use 'html' => TRUE -- this one might require a reroll. Let's ask the test bot ...
#23
The 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!!
#24
Automatically closed -- issue fixed for 2 weeks with no activity.