Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14420357
D7602.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
D7602.diff
View Options
Index: resources/sql/patches/20131118.ownerorder.php
===================================================================
--- /dev/null
+++ 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";
Index: src/applications/maniphest/editor/ManiphestTransactionEditor.php
===================================================================
--- src/applications/maniphest/editor/ManiphestTransactionEditor.php
+++ 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:
Index: src/infrastructure/storage/patch/PhabricatorBuiltinPatchList.php
===================================================================
--- src/infrastructure/storage/patch/PhabricatorBuiltinPatchList.php
+++ 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/plain
Expires
Thu, Dec 26, 5:29 AM (11 h, 15 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6928557
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