Page MenuHomePhabricator

D16355.id.diff
No OneTemporary

D16355.id.diff

diff --git a/src/infrastructure/customfield/field/PhabricatorCustomField.php b/src/infrastructure/customfield/field/PhabricatorCustomField.php
--- a/src/infrastructure/customfield/field/PhabricatorCustomField.php
+++ b/src/infrastructure/customfield/field/PhabricatorCustomField.php
@@ -112,14 +112,13 @@
$object,
array $options = array()) {
- $field_objects = id(new PhutilSymbolLoader())
+ $field_objects = id(new PhutilClassMapQuery())
->setAncestorClass($base_class)
- ->loadObjects();
+ ->execute();
$fields = array();
- $from_map = array();
foreach ($field_objects as $field_object) {
- $current_class = get_class($field_object);
+ $field_object = clone $field_object;
foreach ($field_object->createFields($object) as $field) {
$key = $field->getFieldKey();
if (isset($fields[$key])) {
@@ -127,11 +126,10 @@
pht(
"Both '%s' and '%s' define a custom field with ".
"field key '%s'. Field keys must be unique.",
- $from_map[$key],
- $current_class,
+ get_class($fields[$key]),
+ get_class($field),
$key));
}
- $from_map[$key] = $current_class;
$fields[$key] = $field;
}
}
@@ -146,11 +144,13 @@
if (empty($options['withDisabled'])) {
foreach ($fields as $key => $field) {
- $config = idx($spec, $key, array()) + array(
- 'disabled' => $field->shouldDisableByDefault(),
- );
+ if (isset($spec[$key]['disabled'])) {
+ $is_disabled = $spec[$key]['disabled'];
+ } else {
+ $is_disabled = $field->shouldDisableByDefault();
+ }
- if (!empty($config['disabled'])) {
+ if ($is_disabled) {
if ($field->canDisableField()) {
unset($fields[$key]);
}

File Metadata

Mime Type
text/plain
Expires
Fri, Oct 25, 4:24 AM (3 w, 3 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6743178
Default Alt Text
D16355.id.diff (1 KB)

Event Timeline