Issue #2603636 by joelpittet, Spleshka: profile2_access() has an optional second parameter but tries to use $profile->type right away