From 603cf474ee1d098ae9e4107d4fefdf1cacc71475 Mon Sep 17 00:00:00 2001 From: Aviv Eyal Date: Mon, 3 Jul 2023 13:46:25 -0700 Subject: [PATCH] Fix int fields for now Summary: Fix T15516 Test Plan: Viewed an "int" custom field, no boom. Reviewers: speck, valerio.bozzolan, O1 Blessed Committers Reviewed By: valerio.bozzolan, O1 Blessed Committers Subscribers: tobiaswiese, Matthew, Cigaryno Maniphest Tasks: T15516 Differential Revision: https://we.phorge.it/D25325 --- .../standard/PhabricatorStandardCustomField.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/infrastructure/customfield/standard/PhabricatorStandardCustomField.php b/src/infrastructure/customfield/standard/PhabricatorStandardCustomField.php index 37f9e808ab..373aa9b66a 100644 --- a/src/infrastructure/customfield/standard/PhabricatorStandardCustomField.php +++ b/src/infrastructure/customfield/standard/PhabricatorStandardCustomField.php @@ -301,10 +301,14 @@ abstract class PhabricatorStandardCustomField } public function renderPropertyViewValue(array $handles) { - if (!phutil_nonempty_string($this->getFieldValue())) { - return null; + // If your field needs to render anything more complicated then a string, + // then you should override this method. + $value_str = phutil_string_cast($this->getFieldValue()); + + if (phutil_nonempty_string($value_str)) { + return $value_str; } - return $this->getFieldValue(); + return null; } public function shouldAppearInApplicationSearch() {