Needs review
Project:
Comment OG
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
25 Nov 2015 at 20:37 UTC
Updated:
6 Oct 2017 at 14:28 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
firewaller commentedComment #3
formatC'vt commentedComment #4
firewaller commentedThe above patch resulted in the following error when using another module (Authcache) which also modifies the comment links:
Notice: Undefined index: title in theme_links() (line 1828 of /includes/theme.inc).I rewrote the above patch to check for the existing link key before rebuilding the array values.
Comment #5
shaundychkoMaybe I'm missing something, but the patches above seem to do too much by removing the title key from each of the links array. That results in the "Undefined index" error mentioned in comment #4.
Attached is a patch which does only one thing: collect existing links into the
$linksarray before adding new ones. This makes compatibility with the Quote module, which adds it's own link to comments.Comment #6
firewaller commented@ShaunDychko the overwriting of the keys was what initially prompted me to post this issue. (ie. classes key overwritten: https://www.drupal.org/node/1856350#comment-10606780
However, I do see how in some cases the 'title' and 'html' keys might not exist to begin with and throw errors like the one you're seeing.
Attached is an updated patch which includes the changes from your patch and improves upon my previous patches to check for existing keys before inserting values.
Comment #7
hoang027 commentedFor interacting with ajax_comments module (where ajax classes are overwritten by this or another comment-related module), the easiest solution for me is to set the weight of ajax_comments module bigger in the "system" table (e.g. change from 0 to 99) so that the AJAX always run last to add its own HTML classes.
The ajax_comments module already has some codes to take into account the access/permissions of other modules, but not for comment_og yet. In its ajax_comment_menu() function, I had to add this code (it already checked for modules 'comment_goodness' and 'commentaccess'):
Also, when putting variables inside a quoted string, please enclose them with curly braces to avoid potential bug (it's a good practice anyway):
"comment/$comment->cid/delete/$group->gid"should be"comment/{$comment->cid}/delete/{$group->gid}"And og_context() now returns an array so
$group->gidshould be$group['gid']