Differential D8514 Diff 20196 src/applications/differential/conduit/ConduitAPI_differential_getcommitmessage_Method.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/differential/conduit/ConduitAPI_differential_getcommitmessage_Method.php
Show First 20 Lines • Show All 59 Lines • ▼ Show 20 Lines | protected function execute(ConduitAPIRequest $request) { | ||||
$field_map = mpull($field_list->getFields(), null, 'getFieldKeyForConduit'); | $field_map = mpull($field_list->getFields(), null, 'getFieldKeyForConduit'); | ||||
if ($is_edit) { | if ($is_edit) { | ||||
$fields = $request->getValue('fields', array()); | $fields = $request->getValue('fields', array()); | ||||
foreach ($fields as $field => $value) { | foreach ($fields as $field => $value) { | ||||
$custom_field = idx($field_map, $field); | $custom_field = idx($field_map, $field); | ||||
if (!$custom_field) { | if (!$custom_field) { | ||||
throw new Exception( | // Just ignore this, these workflows don't make strong distictions | ||||
pht( | // about field editability on the client side. | ||||
'Commit message includes field "%s", but this field does not '. | continue; | ||||
'correspond to a known field.', | |||||
$field)); | |||||
} | } | ||||
if ($is_create || | if ($is_create || | ||||
$custom_field->shouldOverwriteWhenCommitMessageIsEdited()) { | $custom_field->shouldOverwriteWhenCommitMessageIsEdited()) { | ||||
$custom_field->readValueFromCommitMessage($value); | $custom_field->readValueFromCommitMessage($value); | ||||
} | } | ||||
} | } | ||||
} | } | ||||
▲ Show 20 Lines • Show All 114 Lines • Show Last 20 Lines |