Both access checking and the logic to determine if someone has already unlocked an achievement return NULL.

CommentFileSizeAuthor
achievement-unlocked-already.patch571 bytesmarcingy

Comments

marcingy’s picture

Status: Active » Needs review
torgospizza’s picture

Issue summary: View changes

I think this approach makes sense. We should return something in either case.

I wonder if we'll need to change this bit further down in the function:

if (isset($achievement_id)) { // return data about a specific unlock if requested.
    return isset($unlocks[$uid][$achievement_id]) ? $unlocks[$uid][$achievement_id] : NULL;
  }
  else { // all of 'em.
    return $unlocks[$uid];
  }

Since the return values here are mixed. Instead of NULL perhaps an empty array, or keeping things consistent from access control above and make it a FALSE instead. Thoughts?