From: Morbus Iff Date: Wed, 14 Dec 2011 13:16:43 +0000 (-0500) Subject: Switching TRUE to NULL in opt-out. X-Git-Tag: 7.x-1.5~18 X-Git-Url: http://drupalcode.org/project/achievements.git/commitdiff_plain/34da989d543d9b21e09241a6734c6eb98d79a670 Switching TRUE to NULL in opt-out. --- diff --git a/achievements.api.php b/achievements.api.php index 9515192..74b0ed9 100644 --- a/achievements.api.php +++ b/achievements.api.php @@ -258,7 +258,8 @@ function example_query_alter(QueryAlterableInterface $query) { * The user ID whose access is being questioned. * * @return - * TRUE if the $uid can earn achievements, FALSE if they can't. + * TRUE if the $uid can earn achievements, FALSE if they can't, + * or NULL if there's no change to the user's default access. */ function example_achievements_access_earn($uid) { $account = user_load($uid); diff --git a/achievements_optout/achievements_optout.module b/achievements_optout/achievements_optout.module index 9390884..0ca3d2b 100644 --- a/achievements_optout/achievements_optout.module +++ b/achievements_optout/achievements_optout.module @@ -44,6 +44,11 @@ function achievements_optout_achievements_access_earn($uid) { ->fieldCondition('achievements_optout', 'value', 1); $result = $query->execute(); - // results? you opted for no access. - return count($result) ? FALSE : TRUE; + // they've opted out. + if (count($result)) { + return FALSE; + } + + // NULL for "no change". + return NULL; } \ No newline at end of file