• Resolved mbearss

    (@mbearss)


    We were having issues with the nomination system on the site. Users who have submitted nominations for badges were unable to receive nominations for the same badge. I was able to fix the problem by modifying
    line 1009 of /includes/submission-actions.php

    // If nomination, modify our query to look for nominations by this user
    	if ( 'nomination' == $feedback_type ) {
    		unset( $args['author'] );
    		$args['meta_query'][] = array(
    			'key'   => '_badgeos_nomination_user_id', // change nominating to nomination
    			'value' => absint( $user_id )
    		);
    	}

    https://www.ads-software.com/plugins/badgeos/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Michael Beckwith

    (@tw2113)

    The BenchPresser

    Curious, because from the best I can tell, that line/function is meant for checking on feedback, not achievement status.

    Thread Starter mbearss

    (@mbearss)

    In function badgeos_create_nomination() line 47

    before the nomination is inserted

    if ( ! badgeos_check_if_user_has_nomination( absint( $user_nominated ), absint( $achievement_id ) ) ) {

    Following that call

    function badgeos_check_if_user_has_nomination( $user_id = 0, $achievement_id = 0 ) {
    	return badgeos_check_if_user_has_feedback( $user_id, $achievement_id, 'nomination' );
    }

    It would seem from the function name that it would check feedback, but this check is causing the nomination to fail.

    Michael Beckwith

    (@tw2113)

    The BenchPresser

    Have you noticed if this same behavior happens both during the process of the nomination, as well as after the nomination has been approved/denied? Wondering if it’s a temporary issue or a permanent one

    Thread Starter mbearss

    (@mbearss)

    I have noticed the issue occurring when the nominations are pending, approved, or denied. The only way I can get a nomination to occur is by modifying the code, or deleting the row from _postmeta.

    Michael Beckwith

    (@tw2113)

    The BenchPresser

    Not sure at this point, I’d need to confer with people to see if they can find any fault in the logic here.

    Opened an issue about it on GitHub and copied over your replies here.

    https://github.com/opencredit/badgeos/issues/448

    Michael Beckwith

    (@tw2113)

    The BenchPresser

    Marking resolved as it’s a known issue.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Possible error in nomination check code’ is closed to new replies.