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?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Anonymous’s picture

Status: Needs work » Needs review
mcrittenden’s picture

So how can I reproduce the error? Something like:

  1. Disallow anonymous users to post comments
  2. Log out
  3. Go and try to post a comment

That right?

netsensei’s picture

Yes, that's right.

pp’s picture

Status: Needs review » Reviewed & tested by the community

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.

robomalo’s picture

This also worked for me.

mcrittenden’s picture

Works for me also. Nice, simple patch. Let's get it in.

pp’s picture

Status: Reviewed & tested by the community » Needs review
FileSize
4.34 KB

I added the test to it. Test is not good, I'am working on it.

pp’s picture

FileSize
4.33 KB

Here is the corrected patch.

pp’s picture

FileSize
4.38 KB

Add little typo.

xmacinfo’s picture

Will 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?

xmacinfo’s picture

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?

xmacinfo’s picture

Edited to erase this comment.

tobiasb’s picture

xmacinfo’s picture

I think this patch is obsolete. See me comment in #11. :-)

pp’s picture

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

xmacinfo’s picture

Thanks! Now I duplicated this error laud and clear. I'll try to review it later, unless someone beats me to it.

Status: Needs review » Needs work

The last submitted patch failed testing.

pp’s picture

Status: Needs work » Needs review
FileSize
4.38 KB

Reroll

xmacinfo’s picture

Status: Needs review » Reviewed & tested by the community

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.

mcrittenden’s picture

Looks good from my end as well.

catch’s picture

Issue tags: +Quick fix
FileSize
4.38 KB

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.

Dries’s picture

I committed #470866: Comment links should use 'html' => TRUE -- this one might require a reroll. Let's ask the test bot ...

webchick’s picture

Status: Reviewed & tested by the community » Fixed

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!!

Status: Fixed » Closed (fixed)
Issue tags: -Quick fix

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