Fix issue on track extra question
default value id was not being saved on multivalue questions Change-Id: Ib5683487e252629b153089719ce1255d69e9eea8
This commit is contained in:
parent
8ffec4ed79
commit
b74da52574
@ -27,7 +27,7 @@ final class TrackMultiValueQuestionTemplateValidationRulesFactory
|
||||
if($update){
|
||||
return [
|
||||
'empty_string' => 'sometimes|string',
|
||||
'default_value' => 'sometimes|integer',
|
||||
'default_value_id' => 'sometimes|integer',
|
||||
];
|
||||
}
|
||||
return [
|
||||
|
@ -173,15 +173,15 @@ final class TrackQuestionTemplateService
|
||||
}
|
||||
|
||||
if($track_question_template instanceof TrackMultiValueQuestionTemplate){
|
||||
if(isset($payload['default_value'])){
|
||||
$default_value = $track_question_template->getValueById(intval($payload['default_value']));
|
||||
if(isset($payload['default_value_id'])){
|
||||
$default_value = $track_question_template->getValueById(intval($payload['default_value_id']));
|
||||
if(is_null($default_value))
|
||||
throw new EntityNotFoundException(
|
||||
trans(
|
||||
"not_found_errors.TrackQuestionTemplateService.updateTrackQuestionTemplate.DefaultValueNotFound"
|
||||
,
|
||||
[
|
||||
'default_value' => $payload['default_value']
|
||||
'default_value_id' => $payload['default_value_id']
|
||||
]
|
||||
)
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user