Clean up obsolete survey editor and DCA code
This commit is contained in:
@@ -76,7 +76,7 @@ final class MemberSurveyEditController extends AbstractFrontendModuleController
|
||||
$surveyForm = $this->formFactory->createNamed('survey_meta', SurveyEditorType::class, $survey instanceof SurveyModel ? SurveyEditorData::fromModel($survey) : new SurveyEditorData());
|
||||
$surveyForm->handleRequest($request);
|
||||
|
||||
if ($surveyForm->isSubmitted() && $surveyForm->isValid()) {
|
||||
if ($surveyForm->isSubmitted() && $surveyForm->isValid() && (!$survey instanceof SurveyModel || '1' !== (string) $survey->published)) {
|
||||
try {
|
||||
if ($survey instanceof SurveyModel) {
|
||||
$this->surveyEditorService->updateSurvey($survey, $memberId, $surveyForm->getData());
|
||||
@@ -92,6 +92,8 @@ final class MemberSurveyEditController extends AbstractFrontendModuleController
|
||||
} catch (\Throwable $exception) {
|
||||
$this->addFlash('error', $exception->getMessage());
|
||||
}
|
||||
} elseif ($surveyForm->isSubmitted() && $survey instanceof SurveyModel && '1' === (string) $survey->published) {
|
||||
$this->addFlash('error', 'Die Metadaten können nach der Veröffentlichung im Frontend nicht mehr geändert werden.');
|
||||
}
|
||||
|
||||
if (!$survey instanceof SurveyModel) {
|
||||
|
||||
Reference in New Issue
Block a user