diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index bd1014a..c0666fd 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -4,6 +4,7 @@ Changelog 1.4.3 - (Unreleased) --------------------------- - Enh #164: Convert swagger docs to OpenAPI 3.0 +- Fix: New Poll missing Answers validation 1.4.2 (November 11, 2025) ------------------------- diff --git a/views/poll/edit.php b/views/poll/edit.php index e1ba411..6e7ea60 100644 --- a/views/poll/edit.php +++ b/views/poll/edit.php @@ -1,12 +1,12 @@ closed) : ?> - 'newAnswers[]', 'showTitle' => true]); ?> + $poll, 'name' => 'newAnswers[]', 'showTitle' => true]); ?> diff --git a/widgets/AddAnswerInput.php b/widgets/AddAnswerInput.php index 0e9ef13..4017dce 100644 --- a/widgets/AddAnswerInput.php +++ b/widgets/AddAnswerInput.php @@ -3,6 +3,7 @@ namespace humhub\modules\polls\widgets; use humhub\components\Widget; +use humhub\modules\polls\models\Poll; /** * PollWallEntryWidget is used to display a poll inside the stream. @@ -15,12 +16,17 @@ */ class AddAnswerInput extends Widget { + public Poll $model; public $name; public $showTitle; public function run() { - return $this->render('addAnswersInput', ['name' => $this->name, 'showTitle' => $this->showTitle]); + return $this->render('addAnswersInput', [ + 'model' => $this->model, + 'name' => $this->name, + 'showTitle' => $this->showTitle, + ]); } } diff --git a/widgets/views/addAnswersInput.php b/widgets/views/addAnswersInput.php index e040eb5..cc5069f 100644 --- a/widgets/views/addAnswersInput.php +++ b/widgets/views/addAnswersInput.php @@ -1,7 +1,10 @@
- " - title=""/> + 'form-control poll_answer_new_input contentForm', + 'placeholder' => Yii::t('PollsModule.base', "Add answer..."), + 'title' => $title, + ]) ?>
@@ -21,10 +25,11 @@ class="form-control poll_answer_new_input contentForm"
- " - title=""/> + 'form-control poll_answer_new_input contentForm', + 'placeholder' => Yii::t('PollsModule.base', "Add answer..."), + 'title' => $title, + ]) ?>
diff --git a/widgets/views/form.php b/widgets/views/form.php index 7e5dd4d..c9bdef5 100644 --- a/widgets/views/form.php +++ b/widgets/views/form.php @@ -1,12 +1,12 @@ label(false) ?> Yii::t('PollsModule.base', 'Answers'), 'class' => 'control-label']); ?> - 'newAnswers[]', 'showTitle' => false]); ?> + $model, 'name' => 'newAnswers[]', 'showTitle' => false]); ?>