when comment form is set to be below comments the talk module shows a "Add comment" link in the talk page
it shouldn't be, instead it might have a local anchor to scroll the page down to the comment form already shown

CommentFileSizeAuthor
#6 talk.patch1.44 KBagentrickard

Comments

volocuga’s picture

Found same problem...Here is my way (drupal 5):

Open talk.module
Around line 191 you will see :
$output .= '<p>' . l(t('Add new comment'), "comment/reply/$node->nid") . '</p>';

Add span class for link

$output .= '<p><span class="talk-add-comment">' . l(t('Add new comment'), "comment/reply/$node->nid") . '</span></p>';

Now you can hide or theme it by css.To hide:

span.talk-add-comment {display:none;}

Note,I am not coder,so method above is stupid may be :) But simple

arhak’s picture

@volocuga: thanks for your workaround, it might help others

still, the "feature request" remains

avpaderno’s picture

Title: hide the add new comment link when comment form is below comments » Hide the "add new comment" link when comment form is below comments
avpaderno’s picture

Version: 6.x-1.4 » 6.x-1.5
Status: Active » Postponed (maintainer needs more info)

I am changing the referring version to the last available. Is the report still valid for this version?

avpaderno’s picture

Status: Postponed (maintainer needs more info) » Active

The report is still valid for the 6.x-1.5 version.

agentrickard’s picture

Status: Active » Needs review
StatusFileSize
new1.44 KB

Here's a fix. This is an svn formatted patch, so maybe someone can update it.

avpaderno’s picture

I don't see anything wrong with the attached patch. I am not sure what the difference between SVN, and CVS patch would be.

I tested it, and it works for me.

agentrickard’s picture

Nothing _wrong_, it should apply, it just isn't standard.

http://drupal.org/patch/create

avpaderno’s picture

I meant that I don't see any significative difference between the format used by the patch you attached, and the format I would normally expect. I am sorry if I was not clear in my statement.

avpaderno’s picture

Status: Needs review » Reviewed & tested by the community
avpaderno’s picture

I am changing the status of the report.

cwgordon7’s picture

@agentrickard - What is the purpose of moving the $comments = comment_render($node, 0); line up before the if block? I mean, it shouldn't cause any harm, but is there a reason behind the change that I'm missing?

avpaderno’s picture

Status: Reviewed & tested by the community » Needs work

Actually, the code should be optimized a little.
With the patch applied, there is are a line like if ($add_comments && $node->comment_count > 0) {, and one like if ($node->comment_count > 1 && $add_comments) { one after the other. It would be preferable to use two nested IFs and avoid to check $add_comments twice.

  if ($add_comments) {
    if ($node->comment_count > 0) {
      // ...
    }
    elseif ($node->comment_count > 1) {
      // ...
    }
  }
agentrickard’s picture

@cwgordon7

No reason. Just a side-effect of how I tested the patch, forgetting that $node->comment_count was already set, I thought I had to load comments before running a check.

I think the change in #13 is a good one, too.

cwgordon7’s picture

Status: Needs work » Fixed

This should be fixed in the development release, thanks everyone.

Status: Fixed » Closed (fixed)

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

silverwing’s picture

Closing comments (due to spam)