Page MenuHomePhabricator

D9833.diff
No OneTemporary

D9833.diff

diff --git a/src/applications/maniphest/editor/ManiphestTransactionEditor.php b/src/applications/maniphest/editor/ManiphestTransactionEditor.php
--- a/src/applications/maniphest/editor/ManiphestTransactionEditor.php
+++ b/src/applications/maniphest/editor/ManiphestTransactionEditor.php
@@ -152,7 +152,9 @@
case ManiphestTransaction::TYPE_CCS:
return $object->setCCPHIDs($xaction->getNewValue());
case ManiphestTransaction::TYPE_PROJECTS:
- return $object->setProjectPHIDs($xaction->getNewValue());
+ $object->setProjectPHIDs($xaction->getNewValue());
+ ManiphestTaskProject::updateTaskProjects($object);
+ return $object;
case ManiphestTransaction::TYPE_EDGE:
// These are a weird, funky mess and are already being applied by the
// time we reach this.
@@ -415,19 +417,6 @@
$existing_cc = $object->getCCPHIDs();
$new_cc = array_unique(array_merge($cc_phids, $existing_cc));
$object->setCCPHIDs($new_cc);
- $save_again = true;
- }
-
- $project_phids = $adapter->getProjectPHIDs();
- if ($project_phids) {
- $existing_projects = $object->getProjectPHIDs();
- $new_projects = array_unique(
- array_merge($project_phids, $existing_projects));
- $object->setProjectPHIDs($new_projects);
- $save_again = true;
- }
-
- if ($save_again) {
$object->save();
}
@@ -442,6 +431,19 @@
->setNewValue($assign_phid);
}
+ $project_phids = $adapter->getProjectPHIDs();
+ if ($project_phids) {
+ $existing_projects = $object->getProjectPHIDs();
+ $new_projects = array_unique(
+ array_merge(
+ $project_phids,
+ $existing_projects));
+
+ $xactions[] = id(new ManiphestTransaction())
+ ->setTransactionType(ManiphestTransaction::TYPE_PROJECTS)
+ ->setNewValue($new_projects);
+ }
+
return $xactions;
}
diff --git a/src/applications/maniphest/storage/ManiphestTask.php b/src/applications/maniphest/storage/ManiphestTask.php
--- a/src/applications/maniphest/storage/ManiphestTask.php
+++ b/src/applications/maniphest/storage/ManiphestTask.php
@@ -30,7 +30,6 @@
protected $attached = array();
protected $projectPHIDs = array();
- private $projectsNeedUpdate;
private $subscribersNeedUpdate;
protected $ownerOrdering;
@@ -92,7 +91,6 @@
public function setProjectPHIDs(array $phids) {
$this->projectPHIDs = array_values($phids);
- $this->projectsNeedUpdate = true;
return $this;
}
@@ -140,13 +138,6 @@
$result = parent::save();
- if ($this->projectsNeedUpdate) {
- // If we've changed the project PHIDs for this task, update the link
- // table.
- ManiphestTaskProject::updateTaskProjects($this);
- $this->projectsNeedUpdate = false;
- }
-
if ($this->subscribersNeedUpdate) {
// If we've changed the subscriber PHIDs for this task, update the link
// table.

File Metadata

Mime Type
text/plain
Expires
Sun, Oct 20, 4:11 AM (1 w, 2 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6723841
Default Alt Text
D9833.diff (2 KB)

Event Timeline