@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Remove all readers/writers for task "subpriority"

Summary:
Depends on D20265. Ref T10333. Now that neither task lists nor workboards use subpriority, we can remove all the readers and writers.

I'm not actually getting rid of the column data yet, but anticipate doing that in a future change.

Note that the subpriority algorithm (removed here) is possibly better than the "natural order" algorithm still in use. It's a bit more clever, and likely performs far fewer writes. I might make the "natural order" code use an algorithm more similar to the "subpriority" algorithm in the future.

Test Plan: Grepped for `subpriority`.

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T10333

Differential Revision: https://secure.phabricator.com/D20266

+5 -558
-2
src/__phutil_library_map__.php
··· 1782 1782 'ManiphestTaskSubpriorityTransaction' => 'applications/maniphest/xaction/ManiphestTaskSubpriorityTransaction.php', 1783 1783 'ManiphestTaskSubtaskController' => 'applications/maniphest/controller/ManiphestTaskSubtaskController.php', 1784 1784 'ManiphestTaskSubtypeDatasource' => 'applications/maniphest/typeahead/ManiphestTaskSubtypeDatasource.php', 1785 - 'ManiphestTaskTestCase' => 'applications/maniphest/__tests__/ManiphestTaskTestCase.php', 1786 1785 'ManiphestTaskTitleHeraldField' => 'applications/maniphest/herald/ManiphestTaskTitleHeraldField.php', 1787 1786 'ManiphestTaskTitleTransaction' => 'applications/maniphest/xaction/ManiphestTaskTitleTransaction.php', 1788 1787 'ManiphestTaskTransactionType' => 'applications/maniphest/xaction/ManiphestTaskTransactionType.php', ··· 7501 7500 'ManiphestTaskSubpriorityTransaction' => 'ManiphestTaskTransactionType', 7502 7501 'ManiphestTaskSubtaskController' => 'ManiphestController', 7503 7502 'ManiphestTaskSubtypeDatasource' => 'PhabricatorTypeaheadDatasource', 7504 - 'ManiphestTaskTestCase' => 'PhabricatorTestCase', 7505 7503 'ManiphestTaskTitleHeraldField' => 'ManiphestTaskHeraldField', 7506 7504 'ManiphestTaskTitleTransaction' => 'ManiphestTaskTransactionType', 7507 7505 'ManiphestTaskTransactionType' => 'PhabricatorModularTransactionType',
-255
src/applications/maniphest/__tests__/ManiphestTaskTestCase.php
··· 1 - <?php 2 - 3 - final class ManiphestTaskTestCase extends PhabricatorTestCase { 4 - 5 - protected function getPhabricatorTestCaseConfiguration() { 6 - return array( 7 - self::PHABRICATOR_TESTCONFIG_BUILD_STORAGE_FIXTURES => true, 8 - ); 9 - } 10 - 11 - public function testTaskReordering() { 12 - $viewer = $this->generateNewTestUser(); 13 - 14 - $t1 = $this->newTask($viewer, pht('Task 1')); 15 - $t2 = $this->newTask($viewer, pht('Task 2')); 16 - $t3 = $this->newTask($viewer, pht('Task 3')); 17 - 18 - $auto_base = min(mpull(array($t1, $t2, $t3), 'getID')); 19 - 20 - 21 - // Default order should be reverse creation. 22 - $tasks = $this->loadTasks($viewer, $auto_base); 23 - $t1 = $tasks[1]; 24 - $t2 = $tasks[2]; 25 - $t3 = $tasks[3]; 26 - $this->assertEqual(array(3, 2, 1), array_keys($tasks)); 27 - 28 - 29 - // Move T3 to the middle. 30 - $this->moveTask($viewer, $t3, $t2, true); 31 - $tasks = $this->loadTasks($viewer, $auto_base); 32 - $t1 = $tasks[1]; 33 - $t2 = $tasks[2]; 34 - $t3 = $tasks[3]; 35 - $this->assertEqual(array(2, 3, 1), array_keys($tasks)); 36 - 37 - 38 - // Move T3 to the end. 39 - $this->moveTask($viewer, $t3, $t1, true); 40 - $tasks = $this->loadTasks($viewer, $auto_base); 41 - $t1 = $tasks[1]; 42 - $t2 = $tasks[2]; 43 - $t3 = $tasks[3]; 44 - $this->assertEqual(array(2, 1, 3), array_keys($tasks)); 45 - 46 - 47 - // Repeat the move above, there should be no overall change in order. 48 - $this->moveTask($viewer, $t3, $t1, true); 49 - $tasks = $this->loadTasks($viewer, $auto_base); 50 - $t1 = $tasks[1]; 51 - $t2 = $tasks[2]; 52 - $t3 = $tasks[3]; 53 - $this->assertEqual(array(2, 1, 3), array_keys($tasks)); 54 - 55 - 56 - // Move T3 to the first slot in the priority. 57 - $this->movePriority($viewer, $t3, $t3->getPriority(), false); 58 - $tasks = $this->loadTasks($viewer, $auto_base); 59 - $t1 = $tasks[1]; 60 - $t2 = $tasks[2]; 61 - $t3 = $tasks[3]; 62 - $this->assertEqual(array(3, 2, 1), array_keys($tasks)); 63 - 64 - 65 - // Move T3 to the last slot in the priority. 66 - $this->movePriority($viewer, $t3, $t3->getPriority(), true); 67 - $tasks = $this->loadTasks($viewer, $auto_base); 68 - $t1 = $tasks[1]; 69 - $t2 = $tasks[2]; 70 - $t3 = $tasks[3]; 71 - $this->assertEqual(array(2, 1, 3), array_keys($tasks)); 72 - 73 - 74 - // Move T3 before T2. 75 - $this->moveTask($viewer, $t3, $t2, false); 76 - $tasks = $this->loadTasks($viewer, $auto_base); 77 - $t1 = $tasks[1]; 78 - $t2 = $tasks[2]; 79 - $t3 = $tasks[3]; 80 - $this->assertEqual(array(3, 2, 1), array_keys($tasks)); 81 - 82 - 83 - // Move T3 before T1. 84 - $this->moveTask($viewer, $t3, $t1, false); 85 - $tasks = $this->loadTasks($viewer, $auto_base); 86 - $t1 = $tasks[1]; 87 - $t2 = $tasks[2]; 88 - $t3 = $tasks[3]; 89 - $this->assertEqual(array(2, 3, 1), array_keys($tasks)); 90 - 91 - } 92 - 93 - public function testTaskAdjacentBlocks() { 94 - $viewer = $this->generateNewTestUser(); 95 - 96 - $t = array(); 97 - for ($ii = 1; $ii < 10; $ii++) { 98 - $t[$ii] = $this->newTask($viewer, pht('Task Block %d', $ii)); 99 - 100 - // This makes sure this test remains meaningful if we begin assigning 101 - // subpriorities when tasks are created. 102 - $t[$ii]->setSubpriority(0)->save(); 103 - } 104 - 105 - $auto_base = min(mpull($t, 'getID')); 106 - 107 - $tasks = $this->loadTasks($viewer, $auto_base); 108 - $this->assertEqual( 109 - array(9, 8, 7, 6, 5, 4, 3, 2, 1), 110 - array_keys($tasks)); 111 - 112 - $this->moveTask($viewer, $t[9], $t[8], true); 113 - $tasks = $this->loadTasks($viewer, $auto_base); 114 - $this->assertEqual( 115 - array(8, 9, 7, 6, 5, 4, 3, 2, 1), 116 - array_keys($tasks)); 117 - 118 - // When there is a large block of tasks which all have the same 119 - // subpriority, they should be assigned distinct subpriorities as a 120 - // side effect of having a task moved into the block. 121 - 122 - $subpri = mpull($tasks, 'getSubpriority'); 123 - $unique_subpri = array_unique($subpri); 124 - $this->assertEqual( 125 - 9, 126 - count($subpri), 127 - pht('Expected subpriorities to be distributed.')); 128 - 129 - // Move task 9 to the end. 130 - $this->moveTask($viewer, $t[9], $t[1], true); 131 - $tasks = $this->loadTasks($viewer, $auto_base); 132 - $this->assertEqual( 133 - array(8, 7, 6, 5, 4, 3, 2, 1, 9), 134 - array_keys($tasks)); 135 - 136 - // Move task 3 to the beginning. 137 - $this->moveTask($viewer, $t[3], $t[8], false); 138 - $tasks = $this->loadTasks($viewer, $auto_base); 139 - $this->assertEqual( 140 - array(3, 8, 7, 6, 5, 4, 2, 1, 9), 141 - array_keys($tasks)); 142 - 143 - // Move task 3 to the end. 144 - $this->moveTask($viewer, $t[3], $t[9], true); 145 - $tasks = $this->loadTasks($viewer, $auto_base); 146 - $this->assertEqual( 147 - array(8, 7, 6, 5, 4, 2, 1, 9, 3), 148 - array_keys($tasks)); 149 - 150 - // Move task 5 to before task 4 (this is its current position). 151 - $this->moveTask($viewer, $t[5], $t[4], false); 152 - $tasks = $this->loadTasks($viewer, $auto_base); 153 - $this->assertEqual( 154 - array(8, 7, 6, 5, 4, 2, 1, 9, 3), 155 - array_keys($tasks)); 156 - } 157 - 158 - private function newTask(PhabricatorUser $viewer, $title) { 159 - $task = ManiphestTask::initializeNewTask($viewer); 160 - 161 - $xactions = array(); 162 - 163 - $xactions[] = id(new ManiphestTransaction()) 164 - ->setTransactionType(ManiphestTaskTitleTransaction::TRANSACTIONTYPE) 165 - ->setNewValue($title); 166 - 167 - 168 - $this->applyTaskTransactions($viewer, $task, $xactions); 169 - 170 - return $task; 171 - } 172 - 173 - private function loadTasks(PhabricatorUser $viewer, $auto_base) { 174 - $tasks = id(new ManiphestTaskQuery()) 175 - ->setViewer($viewer) 176 - ->setOrder(ManiphestTaskQuery::ORDER_PRIORITY) 177 - ->execute(); 178 - 179 - // NOTE: AUTO_INCREMENT changes survive ROLLBACK, and we can't throw them 180 - // away without committing the current transaction, so we adjust the 181 - // apparent task IDs as though the first one had been ID 1. This makes the 182 - // tests a little easier to understand. 183 - 184 - $map = array(); 185 - foreach ($tasks as $task) { 186 - $map[($task->getID() - $auto_base) + 1] = $task; 187 - } 188 - 189 - return $map; 190 - } 191 - 192 - private function moveTask(PhabricatorUser $viewer, $src, $dst, $is_after) { 193 - list($pri, $sub) = ManiphestTransactionEditor::getAdjacentSubpriority( 194 - $dst, 195 - $is_after); 196 - 197 - $keyword_map = ManiphestTaskPriority::getTaskPriorityKeywordsMap(); 198 - $keyword = head($keyword_map[$pri]); 199 - 200 - $xactions = array(); 201 - 202 - $xactions[] = id(new ManiphestTransaction()) 203 - ->setTransactionType(ManiphestTaskPriorityTransaction::TRANSACTIONTYPE) 204 - ->setNewValue($keyword); 205 - 206 - $xactions[] = id(new ManiphestTransaction()) 207 - ->setTransactionType(ManiphestTaskSubpriorityTransaction::TRANSACTIONTYPE) 208 - ->setNewValue($sub); 209 - 210 - return $this->applyTaskTransactions($viewer, $src, $xactions); 211 - } 212 - 213 - private function movePriority( 214 - PhabricatorUser $viewer, 215 - $src, 216 - $target_priority, 217 - $is_end) { 218 - 219 - list($pri, $sub) = ManiphestTransactionEditor::getEdgeSubpriority( 220 - $target_priority, 221 - $is_end); 222 - 223 - $keyword_map = ManiphestTaskPriority::getTaskPriorityKeywordsMap(); 224 - $keyword = head($keyword_map[$pri]); 225 - 226 - $xactions = array(); 227 - 228 - $xactions[] = id(new ManiphestTransaction()) 229 - ->setTransactionType(ManiphestTaskPriorityTransaction::TRANSACTIONTYPE) 230 - ->setNewValue($keyword); 231 - 232 - $xactions[] = id(new ManiphestTransaction()) 233 - ->setTransactionType(ManiphestTaskSubpriorityTransaction::TRANSACTIONTYPE) 234 - ->setNewValue($sub); 235 - 236 - return $this->applyTaskTransactions($viewer, $src, $xactions); 237 - } 238 - 239 - private function applyTaskTransactions( 240 - PhabricatorUser $viewer, 241 - ManiphestTask $task, 242 - array $xactions) { 243 - 244 - $content_source = $this->newContentSource(); 245 - 246 - $editor = id(new ManiphestTransactionEditor()) 247 - ->setActor($viewer) 248 - ->setContentSource($content_source) 249 - ->setContinueOnNoEffect(true) 250 - ->applyTransactions($task, $xactions); 251 - 252 - return $task; 253 - } 254 - 255 - }
-245
src/applications/maniphest/editor/ManiphestTransactionEditor.php
··· 297 297 return $copy; 298 298 } 299 299 300 - /** 301 - * Get priorities for moving a task to a new priority. 302 - */ 303 - public static function getEdgeSubpriority( 304 - $priority, 305 - $is_end) { 306 - 307 - $query = id(new ManiphestTaskQuery()) 308 - ->setViewer(PhabricatorUser::getOmnipotentUser()) 309 - ->withPriorities(array($priority)) 310 - ->setLimit(1); 311 - 312 - if ($is_end) { 313 - $query->setOrderVector(array('-priority', '-subpriority', '-id')); 314 - } else { 315 - $query->setOrderVector(array('priority', 'subpriority', 'id')); 316 - } 317 - 318 - $result = $query->executeOne(); 319 - $step = (double)(2 << 32); 320 - 321 - if ($result) { 322 - $base = $result->getSubpriority(); 323 - if ($is_end) { 324 - $sub = ($base - $step); 325 - } else { 326 - $sub = ($base + $step); 327 - } 328 - } else { 329 - $sub = 0; 330 - } 331 - 332 - return array($priority, $sub); 333 - } 334 - 335 - 336 - /** 337 - * Get priorities for moving a task before or after another task. 338 - */ 339 - public static function getAdjacentSubpriority( 340 - ManiphestTask $dst, 341 - $is_after) { 342 - 343 - $query = id(new ManiphestTaskQuery()) 344 - ->setViewer(PhabricatorUser::getOmnipotentUser()) 345 - ->setOrder(ManiphestTaskQuery::ORDER_PRIORITY) 346 - ->withPriorities(array($dst->getPriority())) 347 - ->setLimit(1); 348 - 349 - if ($is_after) { 350 - $query->setAfterID($dst->getID()); 351 - } else { 352 - $query->setBeforeID($dst->getID()); 353 - } 354 - 355 - $adjacent = $query->executeOne(); 356 - 357 - $base = $dst->getSubpriority(); 358 - $step = (double)(2 << 32); 359 - 360 - // If we find an adjacent task, we average the two subpriorities and 361 - // return the result. 362 - if ($adjacent) { 363 - $epsilon = 1.0; 364 - 365 - // If the adjacent task has a subpriority that is identical or very 366 - // close to the task we're looking at, we're going to spread out all 367 - // the nearby tasks. 368 - 369 - $adjacent_sub = $adjacent->getSubpriority(); 370 - if ((abs($adjacent_sub - $base) < $epsilon)) { 371 - $base = self::disperseBlock( 372 - $dst, 373 - $epsilon * 2); 374 - if ($is_after) { 375 - $sub = $base - $epsilon; 376 - } else { 377 - $sub = $base + $epsilon; 378 - } 379 - } else { 380 - $sub = ($adjacent_sub + $base) / 2; 381 - } 382 - } else { 383 - // Otherwise, we take a step away from the target's subpriority and 384 - // use that. 385 - if ($is_after) { 386 - $sub = ($base - $step); 387 - } else { 388 - $sub = ($base + $step); 389 - } 390 - } 391 - 392 - return array($dst->getPriority(), $sub); 393 - } 394 - 395 - /** 396 - * Distribute a cluster of tasks with similar subpriorities. 397 - */ 398 - private static function disperseBlock( 399 - ManiphestTask $task, 400 - $spacing) { 401 - 402 - $conn = $task->establishConnection('w'); 403 - 404 - // Find a block of subpriority space which is, on average, sparse enough 405 - // to hold all the tasks that are inside it with a reasonable level of 406 - // separation between them. 407 - 408 - // We'll start by looking near the target task for a range of numbers 409 - // which has more space available than tasks. For example, if the target 410 - // task has subpriority 33 and we want to separate each task by at least 1, 411 - // we might start by looking in the range [23, 43]. 412 - 413 - // If we find fewer than 20 tasks there, we have room to reassign them 414 - // with the desired level of separation. We space them out, then we're 415 - // done. 416 - 417 - // However: if we find more than 20 tasks, we don't have enough room to 418 - // distribute them. We'll widen our search and look in a bigger range, 419 - // maybe [13, 53]. This range has more space, so if we find fewer than 420 - // 40 tasks in this range we can spread them out. If we still find too 421 - // many tasks, we keep widening the search. 422 - 423 - $base = $task->getSubpriority(); 424 - 425 - $scale = 4.0; 426 - while (true) { 427 - $range = ($spacing * $scale) / 2.0; 428 - $min = ($base - $range); 429 - $max = ($base + $range); 430 - 431 - $result = queryfx_one( 432 - $conn, 433 - 'SELECT COUNT(*) N FROM %T WHERE priority = %d AND 434 - subpriority BETWEEN %f AND %f', 435 - $task->getTableName(), 436 - $task->getPriority(), 437 - $min, 438 - $max); 439 - 440 - $count = $result['N']; 441 - if ($count < $scale) { 442 - // We have found a block which we can make sparse enough, so bail and 443 - // continue below with our selection. 444 - break; 445 - } 446 - 447 - // This block had too many tasks for its size, so try again with a 448 - // bigger block. 449 - $scale *= 2.0; 450 - } 451 - 452 - $rows = queryfx_all( 453 - $conn, 454 - 'SELECT id FROM %T WHERE priority = %d AND 455 - subpriority BETWEEN %f AND %f 456 - ORDER BY priority, subpriority, id', 457 - $task->getTableName(), 458 - $task->getPriority(), 459 - $min, 460 - $max); 461 - 462 - $task_id = $task->getID(); 463 - $result = null; 464 - 465 - // NOTE: In strict mode (which we encourage enabling) we can't structure 466 - // this bulk update as an "INSERT ... ON DUPLICATE KEY UPDATE" unless we 467 - // provide default values for ALL of the columns that don't have defaults. 468 - 469 - // This is gross, but we may be moving enough rows that individual 470 - // queries are unreasonably slow. An alternate construction which might 471 - // be worth evaluating is to use "CASE". Another approach is to disable 472 - // strict mode for this query. 473 - 474 - $default_str = qsprintf($conn, '%s', ''); 475 - $default_int = qsprintf($conn, '%d', 0); 476 - 477 - $extra_columns = array( 478 - 'phid' => $default_str, 479 - 'authorPHID' => $default_str, 480 - 'status' => $default_str, 481 - 'priority' => $default_int, 482 - 'title' => $default_str, 483 - 'description' => $default_str, 484 - 'dateCreated' => $default_int, 485 - 'dateModified' => $default_int, 486 - 'mailKey' => $default_str, 487 - 'viewPolicy' => $default_str, 488 - 'editPolicy' => $default_str, 489 - 'ownerOrdering' => $default_str, 490 - 'spacePHID' => $default_str, 491 - 'bridgedObjectPHID' => $default_str, 492 - 'properties' => $default_str, 493 - 'points' => $default_int, 494 - 'subtype' => $default_str, 495 - ); 496 - 497 - $sql = array(); 498 - $offset = 0; 499 - 500 - // Often, we'll have more room than we need in the range. Distribute the 501 - // tasks evenly over the whole range so that we're less likely to end up 502 - // with tasks spaced exactly the minimum distance apart, which may 503 - // get shifted again later. We have one fewer space to distribute than we 504 - // have tasks. 505 - $divisor = (double)(count($rows) - 1.0); 506 - if ($divisor > 0) { 507 - $available_distance = (($max - $min) / $divisor); 508 - } else { 509 - $available_distance = 0.0; 510 - } 511 - 512 - foreach ($rows as $row) { 513 - $subpriority = $min + ($offset * $available_distance); 514 - 515 - // If this is the task that we're spreading out relative to, keep track 516 - // of where it is ending up so we can return the new subpriority. 517 - $id = $row['id']; 518 - if ($id == $task_id) { 519 - $result = $subpriority; 520 - } 521 - 522 - $sql[] = qsprintf( 523 - $conn, 524 - '(%d, %LQ, %f)', 525 - $id, 526 - $extra_columns, 527 - $subpriority); 528 - 529 - $offset++; 530 - } 531 - 532 - foreach (PhabricatorLiskDAO::chunkSQL($sql) as $chunk) { 533 - queryfx( 534 - $conn, 535 - 'INSERT INTO %T (id, %LC, subpriority) VALUES %LQ 536 - ON DUPLICATE KEY UPDATE subpriority = VALUES(subpriority)', 537 - $task->getTableName(), 538 - array_keys($extra_columns), 539 - $chunk); 540 - } 541 - 542 - return $result; 543 - } 544 - 545 300 protected function validateAllTransactions( 546 301 PhabricatorLiskDAO $object, 547 302 array $xactions) {
-5
src/applications/maniphest/lipsum/PhabricatorManiphestTaskTestDataGenerator.php
··· 14 14 $author = id(new PhabricatorUser()) 15 15 ->loadOneWhere('phid = %s', $author_phid); 16 16 $task = ManiphestTask::initializeNewTask($author) 17 - ->setSubPriority($this->generateTaskSubPriority()) 18 17 ->setTitle($this->generateTitle()); 19 18 20 19 $content_source = $this->getLipsumContentSource(); ··· 104 103 $keyword_map = ManiphestTaskPriority::getTaskPriorityKeywordsMap(); 105 104 $keyword = head(idx($keyword_map, $pri)); 106 105 return $keyword; 107 - } 108 - 109 - public function generateTaskSubPriority() { 110 - return rand(2 << 16, 2 << 32); 111 106 } 112 107 113 108 public function generateTaskStatus() {
+1 -14
src/applications/maniphest/query/ManiphestTaskQuery.php
··· 435 435 $this->priorities); 436 436 } 437 437 438 - if ($this->subpriorities !== null) { 439 - $where[] = qsprintf( 440 - $conn, 441 - 'task.subpriority IN (%Lf)', 442 - $this->subpriorities); 443 - } 444 - 445 438 if ($this->bridgedObjectPHIDs !== null) { 446 439 $where[] = qsprintf( 447 440 $conn, ··· 844 837 public function getBuiltinOrders() { 845 838 $orders = array( 846 839 'priority' => array( 847 - 'vector' => array('priority', 'subpriority', 'id'), 840 + 'vector' => array('priority', 'id'), 848 841 'name' => pht('Priority'), 849 842 'aliases' => array(self::ORDER_PRIORITY), 850 843 ), ··· 919 912 'type' => 'string', 920 913 'reverse' => true, 921 914 ), 922 - 'subpriority' => array( 923 - 'table' => 'task', 924 - 'column' => 'subpriority', 925 - 'type' => 'float', 926 - ), 927 915 'updated' => array( 928 916 'table' => 'task', 929 917 'column' => 'dateModified', ··· 948 936 $map = array( 949 937 'id' => $task->getID(), 950 938 'priority' => $task->getPriority(), 951 - 'subpriority' => $task->getSubpriority(), 952 939 'owner' => $task->getOwnerOrdering(), 953 940 'status' => $task->getStatus(), 954 941 'title' => $task->getTitle(),
-34
src/applications/maniphest/storage/ManiphestTask.php
··· 267 267 return ManiphestTaskPriority::UNKNOWN_PRIORITY_KEYWORD; 268 268 } 269 269 270 - private function comparePriorityTo(ManiphestTask $other) { 271 - $upri = $this->getPriority(); 272 - $vpri = $other->getPriority(); 273 - 274 - if ($upri != $vpri) { 275 - return ($upri - $vpri); 276 - } 277 - 278 - $usub = $this->getSubpriority(); 279 - $vsub = $other->getSubpriority(); 280 - 281 - if ($usub != $vsub) { 282 - return ($usub - $vsub); 283 - } 284 - 285 - $uid = $this->getID(); 286 - $vid = $other->getID(); 287 - 288 - if ($uid != $vid) { 289 - return ($uid - $vid); 290 - } 291 - 292 - return 0; 293 - } 294 - 295 - public function isLowerPriorityThan(ManiphestTask $other) { 296 - return ($this->comparePriorityTo($other) < 0); 297 - } 298 - 299 - public function isHigherPriorityThan(ManiphestTask $other) { 300 - return ($this->comparePriorityTo($other) > 0); 301 - } 302 - 303 270 public function getWorkboardProperties() { 304 271 return array( 305 272 'status' => $this->getStatus(), ··· 540 507 $priority_value = (int)$this->getPriority(); 541 508 $priority_info = array( 542 509 'value' => $priority_value, 543 - 'subpriority' => (double)$this->getSubpriority(), 544 510 'name' => ManiphestTaskPriority::getTaskPriorityName($priority_value), 545 511 'color' => ManiphestTaskPriority::getTaskPriorityColor($priority_value), 546 512 );
+4 -3
src/applications/maniphest/xaction/ManiphestTaskSubpriorityTransaction.php
··· 6 6 const TRANSACTIONTYPE = 'subpriority'; 7 7 8 8 public function generateOldValue($object) { 9 - return $object->getSubpriority(); 9 + return null; 10 10 } 11 11 12 12 public function applyInternalEffects($object, $value) { 13 - $object->setSubpriority($value); 13 + // This transaction is obsolete, but we're keeping the class around so it 14 + // is hidden from timelines until we destroy the actual transaction data. 15 + throw new PhutilMethodNotImplementedException(); 14 16 } 15 17 16 18 public function shouldHide() { 17 19 return true; 18 20 } 19 - 20 21 21 22 }