Many thanks, Merlin, for this spectacular module.

The bug:
- In Permissions, turn off "post comments" for Anonymous users
- Build a Panels page that includes a "Node being viewed" comment form
- View page as an anonymous user

Result: "Add comment" correctly appears (rather than the comment form, which only appears for Authorized users), but there is no "Login or register to post comments" (with associated links).

Expected: "Login or register to post comments" would appear along with "Add comment".

Workarounds welcome.

CommentFileSizeAuthor
#9 comment_links.patch1.81 KBomerida
#5 comment_form.patch625 bytesomerida

Comments

dalehgeist’s picture

Component: Display rendering » Panel pages

I may be misapprehending what Drupal makes available here. Is there some other way to get the "Login or register" links?

merlinofchaos’s picture

What do you have providing the "add comment" link? This is not printed by the comment form pane, which would actually just print nothing if permission to post comments does not exist, I think.

merlinofchaos’s picture

Status: Active » Postponed (maintainer needs more info)
thirdangel’s picture

Merlinofchaos,

First, have to say I am learning and lovin panels. Thanks alot for an indispensable module.

I am new to Drupal and not a coder.

And I am having the same issue. And you hit the nail on the head as it were... what should be providing the add comment link? I have looked through panels and haven't seen anything that would.

thanks

omerida’s picture

StatusFileSize
new625 bytes

In ctools/plugins/content_types/node_context/node_comment_form.inc, the function ctools_node_comment_form_content_type_render() outputs nothing if the user can't post comments. The attached patch calls the comments module's comment_post_forbidden function which will output the Login/Register links.

merlinofchaos’s picture

Status: Postponed (maintainer needs more info) » Needs review

Aha, that works.

Can we make this optional? Since panes can have settings a simple checkbox should be relatively easy.

sdboyer’s picture

Status: Needs review » Needs work

/me agrees with merlin

Reroll the patch with a settings checkbox so that a) the new behavior is optional and b) it defaults to not showing Login/Register so that anyone using the old version of the pane won't suddenly have new links appearing on their site unexpectedly, and I'll commit it.

omerida’s picture

StatusFileSize
new1.81 KB

Updated patch against 6.x-1.6 attached, config option to display links and it defaults to off.

ycwjjjj’s picture

Version: 6.x-3.2 » 6.x-3.3

patches from #5 and #9 have been applied to my site. But I can't find they are working for me.
theme('comment_post_forbidden', $node); just can't be executed. The option in the setting in node comment form pane has been set, yet there is no links appearing there still.
Any idea? Thanks!

Using modules: ctool 6.x-1.3 and Panels 6.x-3.3

omerida’s picture

comment_post_forbidden is a theme function from the core comments module - do you have it enabled?

ycwjjjj’s picture

Thanks!
Sure. Comments module enabled. I am still finding out why it is.

For "node_content" pane (node_content.inc), when the option "include node links for "add comment"..." is enabled, "Login or register to post comments" can be shown in that pane for anonymous users.
But for "comment form" (pane node_comment_form.inc), after patched, the link still can't be shown.

omerida’s picture

Strange. Are you certain the patch applied? We patched and are using it on dcunited.com where it display correctly.

ioanad’s picture

I am new to Drupal, I do not know many things, so I'm willing to learn. Sure it displays correctly on dcunited.com?
Ioana, Bucuresti

omerida’s picture

did you configure the comment form panel itself to display the links - that's what this patch adds.

see http://screencast.com/t/ODE3ZDQ0

ycwjjjj’s picture

Status: Fixed » Needs work

Yes, I configured the comment form panel itself to "display the links". I will try to do it in another platform to see it works or not. Thanks!

merlinofchaos’s picture

Status: Needs work » Fixed

Other than changing the test to use empty() so that it won't throw a notice, I approve. This is committed.

merlinofchaos’s picture

One note: When a patch has been moved to 'needs work' and you post an update, move it back to 'needs review' -- I did not actually see there was a new patch here until I happened to spot it in my email box.

omerida’s picture

Status: Needs work » Fixed

Thanks Merlin, I didn't know there was a 'needs review' status.

Status: Fixed » Closed (fixed)

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