Fixed removed code

Change-Id: I7962979ff99584c44c153a945d81effedf9fff53
Signed-off-by: smarcet <smarcet@gmail.com>
This commit is contained in:
smarcet 2021-06-04 16:36:20 -03:00
parent b0bf0d7bee
commit f54a626aed
1 changed files with 26 additions and 0 deletions

View File

@ -454,6 +454,32 @@ final class PresentationService
$presentation->setType($event_type);
$presentation->setCategory($track);
// tags
if (isset($data['tags'])) {
$presentation->clearTags();
if (count($data['tags']) > 0) {
if(!$presentation->isCompleted())
$presentation->setProgress(Presentation::PHASE_TAGS);
}
foreach ($data['tags'] as $tag_value) {
$tag = $track->getAllowedTagByVal($tag_value);
if (is_null($tag)) {
throw new ValidationException(
trans(
'validation_errors.PresentationService.saveOrUpdatePresentation.TagNotAllowed',
[
'tag' => $tag_value,
'track_id' => $track->getId()
]
)
);
}
$presentation->addTag($tag);
}
}
return PresentationFactory::populate($presentation, $data);
});
}