Skip to:
Content
Pages
Categories
Search
Top
Bottom

[Tip] Permalink to flagged comments not correct

  • Avatar of dvd3141
    David Hunt
    Participant

    @dvd3141

    I found that this plugin does not generate the correct permalinks to flagged activity comments; the links in the emailed notifications were resulting in 404 errors.

    This is because comments do not, themeselves, have a single page archive. The closest we can get is to open the activity page and jump to the ID of the relevant comment.

    If you want to fix this bug, open bpModActions.php and locate the line:
    `$cont->item_url = $info['url'];`.

    Straight after it, add this:
    `if ($cont->item_type == ‘activity_comment’) {
    $cont->item_url = substr_replace($cont->item_url, $cont->item_id2, -(strlen($cont->item_id)+1));
    $cont->item_url .= ‘/#acomment-’.$cont->item_id;
    }`

    There might be a more elegant way to do this, but so far it works for me.

    To fix other bugs in this plugin to help it work with BP 1.6+, see these two other support thread:

    http://buddypress.org/support/topic/css-issue-with-flagging-option-in-comment-replies/

    http://buddypress.org/support/topic/flagging-does-not-get-processed/

You must be logged in to reply to this topic.