Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F13994701
D9833.id23924.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D9833.id23924.diff
View Options
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
Details
Attached
Mime Type
text/plain
Expires
Thu, Oct 24, 7:54 AM (5 d, 19 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6723841
Default Alt Text
D9833.id23924.diff (2 KB)
Attached To
Mode
D9833: Make Maniphest project edits more transaction-oriented
Attached
Detach File
Event Timeline
Log In to Comment