@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.

lipsum - tighten up some test data generation

Summary:
maniphest tasks were fataling with priority 0 before making sure to add the return null if new object trick to the maniphest pro editor.

pholio had a problem where if you had no jpegs you were walking off array_rand. tighten the math and then just return a built-in if no uploaded user images could be found. Fixes T3889.

Test Plan: bin/lipsum generate for a few minutes and no errors

Reviewers: epriestley

Reviewed By: epriestley

CC: Korvin, aran

Maniphest Tasks: T3889

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

+14 -1
+3
src/applications/maniphest/editor/ManiphestTransactionEditorPro.php
··· 28 28 29 29 switch ($xaction->getTransactionType()) { 30 30 case ManiphestTransaction::TYPE_PRIORITY: 31 + if ($this->getIsNewObject()) { 32 + return null; 33 + } 31 34 return (int)$object->getPriority(); 32 35 case ManiphestTransaction::TYPE_STATUS: 33 36 if ($this->getIsNewObject()) {
+1 -1
src/applications/maniphest/lipsum/PhabricatorManiphestTaskTestDataGenerator.php
··· 49 49 ->setContinueOnNoEffect(true) 50 50 ->setContinueOnMissingFields(true) 51 51 ->applyTransactions($task, $transactions); 52 - return $task->save(); 52 + return $task; 53 53 } 54 54 55 55 public function getCCPHIDs() {
+1
src/applications/maniphest/storage/ManiphestTransaction.php
··· 78 78 switch ($this->getTransactionType()) { 79 79 case self::TYPE_TITLE: 80 80 case self::TYPE_DESCRIPTION: 81 + case self::TYPE_PRIORITY: 81 82 if ($this->getOldValue() === null) { 82 83 return true; 83 84 } else {
+9
src/applications/pholio/lipsum/PhabricatorPholioMockTestDataGenerator.php
··· 92 92 ->loadAllWhere("mimeType = %s", "image/jpeg"); 93 93 $rand_images = array(); 94 94 $quantity = rand(2, 10); 95 + $quantity = min($quantity, count($images)); 95 96 foreach (array_rand($images, $quantity) as $random) { 96 97 $rand_images[] = $images[$random]->getPHID(); 98 + } 99 + // this means you don't have any jpegs yet. we'll 100 + // just use a builtin image 101 + if (empty($rand_images)) { 102 + $default = PhabricatorFile::loadBuiltin( 103 + PhabricatorUser::getOmnipotentUser(), 104 + 'profile.png'); 105 + $rand_images[] = $default->getPHID(); 97 106 } 98 107 return $rand_images; 99 108 }