Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F83546
D7602.diff
All Users
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
D7602.diff
View Options
diff --git a/resources/sql/patches/20131118.ownerorder.php b/resources/sql/patches/20131118.ownerorder.php
new file mode 100644
--- /dev/null
+++ b/resources/sql/patches/20131118.ownerorder.php
@@ -0,0 +1,38 @@
+<?php
+
+$table = new ManiphestTask();
+$conn_w = $table->establishConnection('w');
+
+foreach (new LiskMigrationIterator($table) as $task) {
+ $id = $task->getID();
+
+ echo "Checking task T{$id}...\n";
+ $owner_phid = $task->getOwnerPHID();
+
+ if (!$owner_phid && !$task->getOwnerOrdering()) {
+ // No owner and no ordering; we're all set.
+ continue;
+ }
+
+ $owner_handle = id(new PhabricatorHandleQuery())
+ ->setViewer(PhabricatorUser::getOmnipotentUser())
+ ->withPHIDs(array($owner_phid))
+ ->executeOne();
+
+ if ($owner_handle) {
+ $value = $owner_handle->getName();
+ } else {
+ $value = null;
+ }
+
+ if ($value !== $task->getOwnerOrdering()) {
+ queryfx(
+ $conn_w,
+ 'UPDATE %T SET ownerOrdering = %ns WHERE id = %d',
+ $table->getTableName(),
+ $value,
+ $task->getID());
+ }
+}
+
+echo "Done.\n";
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
@@ -117,7 +117,26 @@
case ManiphestTransaction::TYPE_DESCRIPTION:
return $object->setDescription($xaction->getNewValue());
case ManiphestTransaction::TYPE_OWNER:
- return $object->setOwnerPHID($xaction->getNewValue());
+ $phid = $xaction->getNewValue();
+
+ // Update the "ownerOrdering" column to contain the full name of the
+ // owner, if the task is assigned.
+
+ $handle = null;
+ if ($phid) {
+ $handle = id(new PhabricatorHandleQuery())
+ ->setViewer($this->getActor())
+ ->withPHIDs(array($phid))
+ ->executeOne();
+ }
+
+ if ($handle) {
+ $object->setOwnerOrdering($handle->getName());
+ } else {
+ $object->setOwnerOrdering(null);
+ }
+
+ return $object->setOwnerPHID($phid);
case ManiphestTransaction::TYPE_CCS:
return $object->setCCPHIDs($xaction->getNewValue());
case ManiphestTransaction::TYPE_PROJECTS:
diff --git a/src/infrastructure/storage/patch/PhabricatorBuiltinPatchList.php b/src/infrastructure/storage/patch/PhabricatorBuiltinPatchList.php
--- a/src/infrastructure/storage/patch/PhabricatorBuiltinPatchList.php
+++ b/src/infrastructure/storage/patch/PhabricatorBuiltinPatchList.php
@@ -1756,6 +1756,10 @@
'type' => 'php',
'name' => $this->getPatchPath('20131112.userverified.2.mig.php'),
),
+ '20131118.ownerorder.php' => array(
+ 'type' => 'php',
+ 'name' => $this->getPatchPath('20131118.ownerorder.php'),
+ ),
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-diff
Storage Engine
amazon-s3
Storage Format
Raw Data
Storage Handle
phabricator/4d/nb/yfpszk3uidkexxxk
Default Alt Text
D7602.diff (2 KB)
Attached To
Mode
D7602: Restore population of `ownerOrdering` to ManiphestTasks
Attached
Detach File
Event Timeline
Log In to Comment