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.

on some posts the like doesn't work

2»

Comments

  • peregrineperegrine MVP
    edited April 2013

    I see you got it solved.

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

  • So, I got it working on my site, no idea if this is anyone elses issue or not, but i basically rewrote line 205 in the default.php for the plugin to this

    $DiscussionID = $Sender->DiscussionID;
    //$DiscussionID = $Sender->EventArguments['Discussion']->DiscussionID;
    

    Now I'm worried that the Event Arguments were there for a reason, but I guess time will tell.

  • peregrineperegrine MVP
    edited April 2013

    Your absolutely right - on page 1 of comments

    $Sender->EventArguments['Discussion']->DiscussionID; has a value

    on page 2 of comments and beyond it is null.

    but

    Sender->DiscussionID - always has a value.

    nice fix!

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

  • hbfhbf wiki guy? MVP

    what version of vanilla are you running for which this is an issue?

    i'm using this plugin on my forum and can like posts on any page (page 9707 is the current number to beat)...

    as far as the use of event arguments, i don't recall it being used for a particularly special reason. the key thing is to get the discussion id and comment id reliably.

  • peregrineperegrine MVP
    edited April 2013

    try page 2 of the comments of the same discussion. (not page 2 of discussion topics) . I edited above.

    vanilla 2.0.18.4 and version 0.6

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

  • hbfhbf wiki guy? MVP

    you dont have an option to like or unlike on the discussions pages... it's only show in the discussion controller.

    so im confused by what you are saying.

    I have many, many individual discussion which span several (some thousands) of pages... i like this plugin works on all of them in my forum.

  • peregrineperegrine MVP
    edited April 2013

    If I have 10 comments per page in a discussion. On page 2 e.g. the 15 comment.

    on mine at 205

    $DiscussionID = $Sender->EventArguments['Discussion']->DiscussionID;
    var_dump($Sender->EventArguments['Discussion']->DiscussionID); // null on second page
    var_dump($Sender->DiscussionID);  // always shows an id.
    

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

  • hgtonighthgtonight ∞ · New Moderator

    This may be a bug. I would see if this still happens on 2.1 and file an issue in github.

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • peregrineperegrine MVP
    edited April 2013

    @hgtonight said:
    This may be a bug. I would see if this still happens on 2.1 and file an issue in github.

    It may not be a bug in core, if ($Sender->EventArguments['Discussion']->DiscussionID) is null.

    It may be part of core design.

    It may also be a result of certain config settings that some of us have.

    Perhaps when you change comments on discussion page to less than 50 (which is the default), the problem occurs. I don't have 50 comments per page, I set it to 10 comments per page, so I could test multiple pages easier.

    but under some circumstances - mine and the op

    $Sender->EventArguments is null on the 2nd and following pages of comments.

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

  • hgtonighthgtonight ∞ · New Moderator

    I suppose the event isn't fired on the second page so the ajax comment loading doesn't mess things up? I am speculating now. ;D

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • hbfhbf wiki guy? MVP

    i'm a bit at a loss on it at the moment, but i'll try to look into it a bit next week.

    FWIW - i run 20 comments to a page. and have this plugin on multiple forums, including my primary one.

    maybe someone more familiar with the core can provide me with some insight into the eventargs.

  • hbfhbf wiki guy? MVP
Sign In or Register to comment.