1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-20 09:18:48 +02:00

Make standard fields more liberal about interpreting empty strings

Summary:
Fixes T3867. We currently show more empty custom field values on task detail pages than we should, for at least two reasons:

  - `<select />` fields with an empty string option store `""`, but users reasonably expect this to mean "no value".
  - Old fields may have stored empty strings, and migrated forward.

This fix generally aligns behavior with user expectations. We could get more extreme about not storing `""` in the database, but I think this is generally a less surpsing fix.

Test Plan: Made a select with a `"" : "None"` option, selected it, saw it vanish from task detail screen.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T3867

Differential Revision: https://secure.phabricator.com/D7105
This commit is contained in:
epriestley 2013-09-24 11:30:08 -07:00
parent 099aaa4f94
commit c4f320a7e8
2 changed files with 6 additions and 0 deletions

View file

@ -218,6 +218,9 @@ abstract class PhabricatorStandardCustomField
}
public function renderPropertyViewValue() {
if (!strlen($this->getFieldValue())) {
return null;
}
return $this->getFieldValue();
}

View file

@ -74,6 +74,9 @@ final class PhabricatorStandardCustomFieldSelect
}
public function renderPropertyViewValue() {
if (!strlen($this->getFieldValue())) {
return null;
}
return idx($this->getOptions(), $this->getFieldValue());
}