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

Fix a PHP 8.1 unit test failure in Projects

Summary: Ref T13588. This field may be "null" (and is probably never the empty string, but that's a more ambitious fix).

Test Plan: Ran unit tests, got a pass.

Maniphest Tasks: T13588

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

+13 -5
+4
src/applications/herald/storage/transcript/HeraldTranscript.php
··· 66 66 } 67 67 68 68 private static function combineXHeraldRulesHeaders($u, $v) { 69 + if ($u === null) { 70 + return $v; 71 + } 72 + 69 73 $u = preg_split('/[, ]+/', $u); 70 74 $v = preg_split('/[, ]+/', $v); 71 75
+1 -1
src/applications/project/__tests__/PhabricatorProjectCoreTestCase.php
··· 1435 1435 1436 1436 $task = ManiphestTask::initializeNewTask($viewer); 1437 1437 1438 - if (!strlen($name)) { 1438 + if ($name === null || $name === '') { 1439 1439 $name = pht('Test Task'); 1440 1440 } 1441 1441
+4 -2
src/applications/project/storage/PhabricatorProject.php
··· 407 407 $this->setMailKey(Filesystem::readRandomCharacters(20)); 408 408 } 409 409 410 - if (!strlen($this->getPHID())) { 410 + $phid = $this->getPHID(); 411 + if ($phid === null || $phid === '') { 411 412 $this->setPHID($this->generatePHID()); 412 413 } 413 414 414 - if (!strlen($this->getProjectPathKey())) { 415 + $path_key = $this->getProjectPathKey(); 416 + if ($path_key === null || $path_key === '') { 415 417 $hash = PhabricatorHash::digestForIndex($this->getPHID()); 416 418 $hash = substr($hash, 0, 4); 417 419 $this->setProjectPathKey($hash);
+3 -1
src/applications/transactions/editengine/PhabricatorEditEngine.php
··· 474 474 ->setIsDefault(true) 475 475 ->setIsEdit(true); 476 476 477 - if (!strlen($first->getName())) { 477 + $first_name = $first->getName(); 478 + 479 + if ($first_name === null || $first_name === '') { 478 480 $first->setName($this->getObjectCreateShortText()); 479 481 } 480 482 } else {
+1 -1
src/applications/transactions/storage/PhabricatorEditEngineConfiguration.php
··· 185 185 $fields = $this->reorderFields($fields); 186 186 187 187 $preamble = $this->getPreamble(); 188 - if (strlen($preamble)) { 188 + if ($preamble !== null && strlen($preamble)) { 189 189 $fields = array( 190 190 'config.preamble' => id(new PhabricatorInstructionsEditField()) 191 191 ->setKey('config.preamble')