HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Error when deleting a comment

R_JR_J Ex-FanboyMunich Admin
edited May 2014 in Feedback

With Vanilla 2.1 and OpenGraph enabled, I get an error if I create a comment and immediately delete it (without refreshing the discussion).

Comment is indeed deleted but I can only see that if I reload the page

Comments

  • I've noted the same issue. Anyone have any ideas?

  • R_JR_J Ex-Fanboy Munich Admin

    The usage of $Sender->Discussion->Body causes the error. So you have to do 2 modifications to the plugin in order to get it going.

    First search for this:

    // og:type
    if(strlen($Sender->Discussion->Body) < 1){
    

    and replace with that

    // og:type
    if (isset($Sender->Discussion)) {
        $Description = $Sender->Discussion->Body;
    } else {
        $Description = $Sender->DiscussionModel->EventArguments['Discussion']->Body;
    }
    if(strlen($Description) < 1){
    

    And second, replace this:

    $DefaultDescription= C('Plugins.OpenGraph.DefaultDescription');
    $Description = $Sender->Discussion->Body;
    if(strlen($Description) > 0 || strlen($DefaultDescription) > 0){
    

    with that

    $DefaultDescription= C('Plugins.OpenGraph.DefaultDescription');
    if(strlen($Description) > 0 || strlen($DefaultDescription) > 0){
    
  • @R_J‌ - that did the trick!

    Many thanks, you're a superstar ;)

Sign In or Register to comment.