1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-23 07:12:41 +01:00

Allow standard fields to have defaults

Summary: Final standard capability from Maniphest fields.

Test Plan: This isn't really reachable now since users always exist, but faked it and verified the field prefilled as expected.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Differential Revision: https://secure.phabricator.com/D7033
This commit is contained in:
epriestley 2013-09-19 11:55:28 -07:00
parent 104c6244c3
commit 45ff6077a7
2 changed files with 7 additions and 1 deletions

View file

@ -27,6 +27,7 @@ final class PhabricatorCustomFieldList extends Phobject {
return $this;
}
/**
* Read stored values for all fields which support storage.
*
@ -65,7 +66,9 @@ final class PhabricatorCustomFieldList extends Phobject {
$storage = idx($objects, $key);
if ($storage) {
$field->setValueFromStorage($storage->getFieldValue());
} else {
} else if ($object->getPHID()) {
// NOTE: We set this only if the object exists. Otherwise, we allow the
// field to retain any default value it may have.
$field->setValueFromStorage(null);
}
}

View file

@ -108,6 +108,9 @@ abstract class PhabricatorStandardCustomField
$this->setRequired($value);
$this->setFieldError(true);
break;
case 'default':
$this->setFieldValue($value);
break;
case 'type':
// We set this earlier on.
break;