@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 PHP 8.1 "strlen(null)" exception which blocks rendering list of Active/All projects

Summary:
`strlen()` was used in Phabricator to check if a generic value is a non-empty string.
This behavior is deprecated since PHP 8.1. Phorge adopts `phutil_nonempty_string()` as a replacement.

Note: this may highlight other absurd input values that might be worth correcting
instead of just ignoring. If phutil_nonempty_string() throws an exception in your
instance, report it to Phorge to evaluate and fix that specific corner case.

Closes T15312

Test Plan:
Applied this change (on top of D25144, D25145, D25146, D25147, D25151, D25152, D25153 and `/project/query/active/` rendered correctly in web browser.

Tested surfing various pages with and without Maniphest's `maniphest.subtypes`.

If you need some example custom fields, this is an example:

```
[
{
"key": "default",
"name": "Task"
},
{
"key": "bug",
"name": "Bug"
},
{
"key": "log",
"name": "LogSpam"
},
{
"key": "deadline",
"name": "Deadline"
}
]
```

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: speck, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T15312

Differential Revision: https://we.phorge.it/D25162

+17 -1
+17 -1
src/applications/transactions/editengine/PhabricatorEditEngineSubtype.php
··· 43 43 return $this->icon; 44 44 } 45 45 46 + /** 47 + * Set the text of the tag 48 + * 49 + * This is usually the 'name' key of your subtype map. 50 + * Sometime this is an uppercase text like 'BUG' for a 'bug' subtype name. 51 + * 52 + * @param string|null $text 53 + * @return self 54 + */ 46 55 public function setTagText($text) { 47 56 $this->tagText = $text; 48 57 return $this; 49 58 } 50 59 60 + /** 61 + * Get the text of the tag 62 + * 63 + * @see PhabricatorEditEngineSubtype::setTagText() 64 + * 65 + * @return string|null 66 + */ 51 67 public function getTagText() { 52 68 return $this->tagText; 53 69 } ··· 89 105 } 90 106 91 107 public function hasTagView() { 92 - return (bool)strlen($this->getTagText()); 108 + return phutil_nonempty_string($this->getTagText()); 93 109 } 94 110 95 111 public function newTagView() {