I am attempting to add the Comment Abuse module to enable users report comments which may be offensive.
https://www.drupal.org/project/comment_abuse

However, the links doesn't appear on the comments. Followed all the setup instructions for the module.

Is there any reason why OA may not be rendering the link?

Is there another way to do this?

Comments

mpotter’s picture

Status: Active » Fixed

The theming of comments was not handling additional links correctly. I've pushed some new code to the oa_comments module in commit: 6c6a2f9. That should allow any normal comment link to appear now. This will be in the 2.43 release.

bherring’s picture

Thanks Mike
Has this commit been posted?

dpoletto’s picture

@bherring: have a look here (that's from http://cgit.drupalcode.org/oa_comment/)!

bherring’s picture

I have installed a fresh copy of 2.43 and Comment Abuse as the only additional module.
The links now appear but throw ajax errors.

Ive tried configuring the module with both options to use simple link or popup.

I am now also getting an error
Notice: Undefined index: href in oa_comment_preprocess_comment() (line 113 of /xxxxxxx/profiles/openatrium/modules/apps/oa_comment/oa_comment.theme.inc).

mpotter’s picture

Probably need to post this over in the Comment Abuse module. The 2.43 version of Atrium now adds any links added by other modules. Links are required to have a "title" and "href" field. Sounds like the link added by Comment Abuse is missing the "href" field.

hefox’s picture

I believe http://cgit.drupalcode.org/comment_abuse/tree/comment_abuse.module?h=7.x... is the code that creates the 'link' for comment abuse.

As seen by theme_links documentation

href: The link URL. If omitted, the 'title' is shown as a plain text item in the links list.
html: (optional) Whether or not 'title' is HTML. If set, the title will not be passed through check_plain().

what comment abuse is doing is valid for comment links, but makes it rather hard for anyone who wants to override the themeing of links. Comment abuse links are links, but have special classes/etc. from ctools functions (which return the link rendered) to make the ajax work.

So, comment abuse isn't doing anything wrong, but what is doing makes it harder for people to customize the display of comment links.

Perhaps openatrium can print any comment links that don't have href in a different area?

mpotter’s picture

Yep, we can probably handle this then. Didn't realize href was optional. The code in oa_comment.theme.inc around line 112 just needs another if case for this.

hefox’s picture

Status: Fixed » Active
hefox’s picture

bherring:

    elseif (!isset($link['href'])) {
      $links[$key] = !empty($link['html']) ? $link['title'] : check_plain($link['title']);
    }

Does this on the mentioned line (112 of oa_comment.theme.inc) fix comment abuse?

hefox’s picture

Status: Active » Needs review
StatusFileSize
new600 bytes

Figured I could actually make a patch

bherring’s picture

StatusFileSize
new63.72 KB
new20.69 KB
new24.87 KB

Doesn't seem to have.
I applied the patch, disabled, enabled, cleared cache, etc.

Still getting AJAX error see attached.

Also see 2 errors from error log attached

bherring’s picture

StatusFileSize
new991 bytes

As an option I tried add a FLAG which would be a reasonable solution.
However, the link doesn't appear

See my config attached

socialnicheguru’s picture

This occurs with anything that adds links to comments like http://drupal.org/project/comment_registration

Array ( 
[title] => Log in or register to post comments 
[html] => 1
)

Both "Log in" and "register" are both links themselves

socialnicheguru’s picture

The patch worked for me after clearing caches and registry
drush cc all
drush rr --fire-bazooka

hefox’s picture

Status: Needs review » Active

The patch purely allows the link to appear, and based on the comment about there being an ajax error, looks the patch worked for bherring. So the original issue is fixed, but looks like new issues were revealed, though I'm guessing those issues may be comment abuse issues instead of oa issues.

hefox’s picture

Should add, patch commited to oa_comment

bherring’s picture

I am now using the flag module. However, to show the flag link I needed to modify oa-comment--comment.tpl.php and insert
print flag_create_link('[flag_name]', $comment->cid);

Is there a way to add this without altering the template file?

AntiNSA’s picture

I need to flag comments... did you figure this out?

cgove’s picture

Version: 7.x-2.42 » 7.x-2.618
Status: Active » Fixed

Comment Abuse module works fine for me using their latest dev version on current OA.

Status: Fixed » Closed (fixed)

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