The PHID for logged out users is NULL, but so is the PHID for un-owned objects.
Details
Details
- Reviewers
epriestley - Group Reviewers
Blessed Reviewers - Commits
- Restricted Diffusion Commit
rPa03a488ba61b: Don't claim logged out users are automatically subscribed to un-owned objects
Browse a non-owned object (i.e. unassigned task) while logged out, notice "Automatically subscribed" before this commit.
Diff Detail
Diff Detail
- Repository
- rP Phabricator
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
Comment Actions
Instead of fixing this in every object, let's just fix it in PhabricatorSubscriptionsUIEventListener? Public users can never be subscribed to anything, and it will never make sense to let them subscribe to things (the operation is meaningless) so we don't need to test if they're automatically subscribed at all.
Since "0" isn't a valid PHID, it's sufficient to just test for $phid instead of !is_null($phid).
Comment Actions
Just fix the caller in PhabricatorSubscriptionsUIEventListener.
Fiddle around with user PHID variables to avoid >80 characters lint warning.
Comment Actions
Thanks!
src/applications/subscriptions/interface/PhabricatorSubscribableInterface.php | ||
---|---|---|
10–11 ↗ | (On Diff #30741) | I think this is obsolete, I'll just leave it out of the pull. |