Page MenuHomePhabricator

'select' type custom field defaults do not default the selection
Closed, DuplicatePublic

Description

I'd expect that the default for a select style field would (A) be the default in the select ui list (B) be the default when it wasn't specified (like if the ticket was created via conduit or something). Instead if looks like only (B) is the case.

'addthis:scope' => array(
  'name' => 'Scope',
  'type' => 'select',
  'caption' => 'Like a T-Shirt',
  'default' => 'medium',
  'options' => array(
    'addthis:small' => 'small',
    'addthis:medium' => 'medium',
    'addthis:large' => 'large'
  ),
  'required' => true,
  'edit' => true,
  'view' => true,
  'search' => true,
  'copy' => true,
  'search' => true,
),

With creating a new ticket the selection box is set on 'small' to start with. When the ticket is created 'Scope from medium to small' showing that setting ''default' => 'medium'` is recognized . Worse the selection box "default" of value takes precedence over the default specified in the custom field.

Event Timeline

cburroughs raised the priority of this task from to Needs Triage.
cburroughs updated the task description. (Show Details)
cburroughs added a project: Custom Fields.
cburroughs added a subscriber: cburroughs.

This might be the same as T5158 but I have to read them again.

I traced it back to setValueFromStorage in PhabricatorStandardCustomField and got lost after that. My little designer brain gave up.

Looks like the same issue, I can confirm in my sandbox.