diff --git a/achievements.api.php b/achievements.api.php index 9515192242e7f1b5d25813b1819c75c351a762b5..74b0ed9190b195504987a87ff01827a9f00f748d 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 9390884e85234419fd22cf866b813bd6c627d719..0ca3d2b8d50c76b474807ce64ef591ebc60bb4e9 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