Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Try Vanilla Forums Cloud product
Vanilla 2.6.1 is here with critical security patches. One of them has been publicly disclosed.
Please upgrade to 2.3 here. The 2.2 and earlier branches are no longer being updated.

When Admin accepts an answer - no Karma is given

This discussion is related to the Karma Bank addon.

Has anyone else experienced this issue?

Using the Q&A plugin, when an administrator accepts someone's answer to another's question, no karma is given. When the actual poster accepts an answer, karma is correctly given. I've run test after test and this is always the case.

I will keep looking into this myself but if anyone knows a possible solution please add your thoughts.

Comments

  • I think this is becuase admin can accept other people's answers. Makes sense to me, they aren't the OP.

    grep is your friend.

  • I suppose that makes sense, I didn't want to have to rely on the user to check consistently enough to accept answers - but that's another issue

    Overall the plugin works fantastically well - thank you for creating it @x00

  • But you are rewarding them for taking care of that, that is the incentive. If you do it for them it defeats the point.

    grep is your friend.

    peregrine
  • x00 said:
    But you are rewarding them for taking care of that, that is the incentive. If you do it for them it defeats the point.

    Just to bud in, But OTH.....

    If you have a "lazy" person who doesn't accept an answer, it doesn't give credit where credit is due to the op.

    Also that would be a good project for you as a setting option. @kirkpa31 to do the mod the way you want, then you could post your mod.

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

    kirkpa31
  • Ok I see, fair enough.

    grep is your friend.

  • vrijvlindervrijvlinder Papillon-Sauvage MVP

    If you have a "lazy" person who doesn't accept an answer, it doesn't give credit where credit is due

    Or the accept best answer button does not appear. I have yet to see it come up when I have asked a question :) Some people don't even know that is the procedure, get help mark best answer accepted. I think the reactions have more impact sometimes. 10 awesomes makes it the best answer or something like that no?

  • peregrineperegrine MVP
    edited April 2013

    never mind.

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

  • Also that would be a good project for you as a setting option. @kirkpa31 to do the mod the way you want, then you could post your mod.

    I had to take yesterday off but can try a worm around a possible solution @peregrine b/c I think this would be a good addition to make sure everyone gets proper credit - otherwise the karma incentive may start to be defeated.

  • Looking at this code:

                  // Check for permission (let QnA handle exceptions)
                if ((Gdn::Session()->UserID == GetValue('InsertUserID', $Discussion) /*|| Gdn::Session()->CheckPermission('Garden.Moderation.Manage')*/)){
                    if (Gdn::Session()->ValidateTransientKey(GetValue('tkey',$_GET))){
    
                        $Args=$Sender->ControllerArguments();
                        if($Args[0]=='accept'){
    
                            if ($Discussion['QnA'] != 'Accepted' && (!$Discussion['QnA'] || in_array($Discussion['QnA'], array('Unanswered', 'Answered', 'Rejected')))){
                                $User = Gdn::UserModel()->GetID($Discussion['InsertUserID']);
                                Gdn::SQL()->Update('User',array('QnACountAccept'=>$User->QnACountAccept+1))->Where(array('UserID'=>$User->UserID))->Put();
                                if(Gdn::Session()->UserID==$User->UserID)
                                    Gdn::Session()->User->QnACountAccept+=1;
                            }
    

    hoping that my attempts at changing bits and pieces within can make this issue go away.

  • kirkpa31kirkpa31 ✭✭
    edited April 2013

    EDIT b/c I'm losing my mind - put the wrong initial file location in here, new one is correct

    actuallly I think this is the code that may need to be altered to change this within /plugins/qna/class.qna.plugin.php

    (I'm partly placing this here as a placeholder so I can come back to it later while i finish up other projects)

          // Check permissions.
          $CanAccept = Gdn::Session()->CheckPermission('Garden.Moderation.Manage');
          $CanAccept |= Gdn::Session()->UserID == GetValue('InsertUserID', $Discussion) && Gdn::Session()->UserID != GetValue('InsertUserID', $Comment);
    
          if (!$CanAccept)
             return;
    
          $QnA = GetValue('QnA', $Comment);
          if ($QnA)
             return;
    
Sign In or Register to comment.