Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

New to vanilla and reply to and can't get them working

hal9000hal9000 New
edited February 2012 in Vanilla 2.0 - 2.8

Hi there, I have a clean install of vanilla (what ever the current latest version is as of yesterday) and today stumbled across reply to:

I think that without the nested comments feature Vanilla is unfortunately useless to me but with it it is exactly what i need.
Now the problem is i can't get it to work.
I am running it on osx MAMP for now testing and have the default theme installed and some of the default plugins turned on but nothing else installed.
I have added the line of code needed ( which appears to be line 19 now btw) and the plugin is enabled.
I see a reply link and it opens a reply comment box below the comment but when i submit the comments aren't nested, unfortunately :(

Any ideas anyone?

Thanks
D

Answers

  • i have turned off all the plugins now as well bar reply to and the same thing happens. i have even restarted the server to make sure it reloads the files needed and i run chrome in a no cache mode

  • Hmm it would appear that after some digging around that the line $Sender->FireEvent('BeforeCommentDisplay'); around line 26 on the file helper_functions.php no longer exists so this might exaplin why i can't get it to work

  • I have put this Plugin up on github here:

    https://github.com/judgej/Vanilla-ReplyTo-Plugin

    Been meaning to do that for a while. I am not actively developing it, but am willing to offer whatever assistance I can to get it working on later versions of Vanilla. Vanilla can be a constantly moving target at times, so we just stuck with the version we had at the time and did not develop this module any further as a consequence.

    Hopefully there is enough structure and enough comments in the code to help you find the fixes. You may well have to create event hooks in Vanilla to fire where required. If you do, I would recommend putting in a change request to make those events more permanent, as the likelihood is that other plugins would need the same hooks.

    Good luck,

    -- Jason

  • Thanks Jason, unfortunately I am just a tinkerer and not a coder, so unless somebody else take up the challenge then it will have to wait untill I find the time to tinker a bit more than usual.
    Thanks for the udpate

  • The line you want to add is
    $Sender->CssClassComment =&$CssClass;
    It should be around line 41.
    directly above
    $Sender->FireEvent('BeforeCommentDisplay');

    /vanilla/views/discussion/helper_functions.php

    Note:this is the discussion directory NOT discussions. I suspect you are not changing the correct helper_functions file.

    The other problem I had was that the reply comment was not showing up for members, commented out a permissions statement to fix that.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • peregrineperegrine MVP
    edited February 2012

    To get the reply anchor showing I had to
    to change code in class.replyto.plugin.php (if you run into the same problem)

    Before:

       
     $CommentID = $Sender->CurrentComment->CommentID;  
      if ($Sender->EventArguments['Type'] == 'Comment') {         
    // Can the user comment on this category, and is the discussion open for comments?        
    if (empty($Sender->Data['Discussion']->Closed)
            && $Session->CheckPermission('Vanilla.Comments.Add', TRUE, 'Category', $CategoryID)
    
    

    After:

        
    $CommentID = $Sender->CurrentComment->CommentID;
    $PermissionCategoryID = GetValue('PermissionCategoryID', $Object, GetValue('PermissionCategoryID', $Sender->Discussion));
    if ($Sender->EventArguments['Type'] == 'Comment') {
      // Can the user comment on this category, and is the discussion open for comments?
    if (empty($Sender->Data['Discussion']->Closed)
          && $Session->CheckPermission('Vanilla.Comments.Add', TRUE, 'Category', $PermissionCategoryID)
    
    

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Thanks Peregrine, I am going to take a look at you fixes maybe this weekend if I get some time.
    Ta

  • This does fix it. What's the problem after you implemented the changes.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • edited July 2012

    Weird I feel like replyto was working at one point but now it stopped. I can't seem to figure out if any other module is conflicting with it. - www.ouyacommunity.com can anyone see anything? I don't see any JS errors or anything.

    I did notice however that the admin see's the reply but not other users. Is that the default? What's up?

  • Looks like line 654 was causing causing users not to see the reply links. Not sure what the CheckPermission is referring too. But once I commented out the line it worked. And logged out users don't see it.

    && $Session->CheckPermission('Vanilla.Comments.Add', TRUE, 'Category', $CategoryID)

  • @peregrine said:
    To get the reply anchor showing I had to
    to change code in class.replyto.plugin.php (if you run into the same problem)

    @peregrine,
    I know long time passed over this but if you can help us, I will appreciate.

    This fixes doesn't work.

    Actually it works but doesn't look like a treee.

    Here is sample.

    http://zahek.net/vani/discussion/comment/17#Comment_17

Sign In or Register to comment.