Page MenuHomePhabricator

D9377.id22351.diff
No OneTemporary

D9377.id22351.diff

diff --git a/src/applications/subscriptions/controller/PhabricatorSubscriptionsEditController.php b/src/applications/subscriptions/controller/PhabricatorSubscriptionsEditController.php
--- a/src/applications/subscriptions/controller/PhabricatorSubscriptionsEditController.php
+++ b/src/applications/subscriptions/controller/PhabricatorSubscriptionsEditController.php
@@ -37,10 +37,24 @@
->withPHIDs(array($phid))
->executeOne();
- $object = id(new PhabricatorObjectQuery())
- ->setViewer($user)
- ->withPHIDs(array($phid))
- ->executeOne();
+ if (phid_get_type($phid) == PhabricatorProjectPHIDTypeProject::TYPECONST) {
+ // TODO: This is a big hack, but a weak argument for adding some kind
+ // of "load for role" feature to ObjectQuery, and also not a really great
+ // argument for adding some kind of "load extra stuff" feature to
+ // SubscriberInterface. Do this for now and wait for the best way forward
+ // to become more clear?
+
+ $object = id(new PhabricatorProjectQuery())
+ ->setViewer($user)
+ ->withPHIDs(array($phid))
+ ->needWatchers(true)
+ ->executeOne();
+ } else {
+ $object = id(new PhabricatorObjectQuery())
+ ->setViewer($user)
+ ->withPHIDs(array($phid))
+ ->executeOne();
+ }
if (!($object instanceof PhabricatorSubscribableInterface)) {
return $this->buildErrorResponse(

File Metadata

Mime Type
text/plain
Expires
Mon, Nov 4, 5:44 PM (2 w, 7 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6720020
Default Alt Text
D9377.id22351.diff (1 KB)

Event Timeline