Page MenuHomePhabricator

D9377.id.diff
No OneTemporary

D9377.id.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
Oct 17 2024, 1:26 AM (4 w, 5 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6720020
Default Alt Text
D9377.id.diff (1 KB)

Event Timeline