Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14843835
D21018.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D21018.diff
View Options
diff --git a/src/applications/doorkeeper/worker/DoorkeeperAsanaFeedWorker.php b/src/applications/doorkeeper/worker/DoorkeeperAsanaFeedWorker.php
--- a/src/applications/doorkeeper/worker/DoorkeeperAsanaFeedWorker.php
+++ b/src/applications/doorkeeper/worker/DoorkeeperAsanaFeedWorker.php
@@ -532,6 +532,7 @@
->withUserPHIDs($all_phids)
->withAccountTypes(array($provider->getProviderType()))
->withAccountDomains(array($provider->getProviderDomain()))
+ ->needAccountIdentifiers(true)
->requireCapabilities(
array(
PhabricatorPolicyCapability::CAN_VIEW,
@@ -540,7 +541,7 @@
->execute();
foreach ($accounts as $account) {
- $phid_map[$account->getUserPHID()] = $account->getAccountID();
+ $phid_map[$account->getUserPHID()] = $this->getAsanaAccountID($account);
}
// Put this back in input order.
@@ -562,6 +563,7 @@
->withUserPHIDs($user_phids)
->withAccountTypes(array($provider->getProviderType()))
->withAccountDomains(array($provider->getProviderDomain()))
+ ->needAccountIdentifiers(true)
->requireCapabilities(
array(
PhabricatorPolicyCapability::CAN_VIEW,
@@ -601,7 +603,7 @@
->withPHIDs(array($account->getUserPHID()))
->executeOne();
if ($user) {
- return array($user, $account->getAccountID(), $token);
+ return array($user, $this->getAsanaAccountID($account), $token);
}
}
@@ -706,4 +708,20 @@
}
}
+ private function getAsanaAccountID(PhabricatorExternalAccount $account) {
+ $identifiers = $account->getAccountIdentifiers();
+
+ if (count($identifiers) !== 1) {
+ throw new Exception(
+ pht(
+ 'Expected external Asana account to have exactly one external '.
+ 'account identifier, found %s.',
+ phutil_count($identifiers)));
+ }
+
+ return head($identifiers)->getIdentifierRaw();
+ }
+
+
+
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Feb 3, 10:38 AM (20 h, 45 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7086747
Default Alt Text
D21018.diff (1 KB)
Attached To
Mode
D21018: Update Asana feed publishing integration for "ExternalAccountIdentifier"
Attached
Detach File
Event Timeline
Log In to Comment