From 842a92bbd9c973925683ea50d45345bb46a0e3e8 Mon Sep 17 00:00:00 2001 From: Ryuji AMANO Date: Sat, 14 Jan 2023 10:19:32 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=88=A5=E3=83=9A=E3=83=BC=E3=82=B8?= =?UTF-8?q?=E3=81=A7=E4=BD=9C=E6=88=90=E6=B8=88=E3=81=BF=E3=81=AE=E7=99=BB?= =?UTF-8?q?=E9=8C=B2=E3=83=95=E3=82=A9=E3=83=BC=E3=83=A0=E3=82=92=E9=81=B8?= =?UTF-8?q?=E3=82=93=E3=81=A7=E3=80=81=E8=A1=A8=E7=94=BB=E9=9D=A2=E3=81=B8?= =?UTF-8?q?=E7=A7=BB=E5=8B=95=E3=81=99=E3=82=8B=E3=81=A8=E3=80=8C=E7=99=BB?= =?UTF-8?q?=E9=8C=B2=E3=83=95=E3=82=A9=E3=83=BC=E3=83=A0=E3=81=8C=E3=81=82?= =?UTF-8?q?=E3=82=8A=E3=81=BE=E3=81=9B=E3=82=93=E3=80=8D=E3=81=AB=E3=81=AA?= =?UTF-8?q?=E3=82=8B=E3=81=AE=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Model/Registration.php | 14 ++++++++++++++ .../EditQuestionTest.php | 3 +-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/Model/Registration.php b/Model/Registration.php index 78f7b07..b6697dd 100644 --- a/Model/Registration.php +++ b/Model/Registration.php @@ -451,6 +451,20 @@ public function afterFind($results, $primary = false) { return $results; } +/** + * afterFrameSave + * + * @param array $frame Frame data + * @return void + */ + public function afterFrameSave($frame) { + // フレームに紐づく登録フォームがあるのにdefault_actionが設定されてなかったら設定する + if ($frame['Frame']['block_id'] && empty($frame['Frame']['default_action'])) { + $frame['Frame']['default_action'] = 'registration_answers/view'; + $this->Frame->save($frame, false); + } + } + /** * ブロック作成 * diff --git a/Test/Case/Controller/RegistrationEditController/EditQuestionTest.php b/Test/Case/Controller/RegistrationEditController/EditQuestionTest.php index e62af34..ce404e6 100644 --- a/Test/Case/Controller/RegistrationEditController/EditQuestionTest.php +++ b/Test/Case/Controller/RegistrationEditController/EditQuestionTest.php @@ -279,12 +279,11 @@ public function dataProviderEditGetByEditable() { 'assert' => array('method' => 'assertInput', 'type' => 'input', 'name' => 'data[RegistrationPage][{{pageIndex}}][RegistrationQuestion][{{qIndex}}][question_value]', 'value' => null), ))); array_push($results, Hash::merge($results[$base], array( - 'assert' => array('method' => 'assertInput', 'type' => 'input', 'name' => 'data[RegistrationPage][{{pageIndex}}][RegistrationQuestion][{{qIndex}}][question_type]', 'value' => null), + 'assert' => array('method' => 'assertInput', 'type' => 'select', 'name' => 'data[RegistrationPage][{{pageIndex}}][RegistrationQuestion][{{qIndex}}][question_type]', 'value' => null), ))); array_push($results, Hash::merge($results[$base], array( 'assert' => array('method' => 'assertInput', 'type' => 'textarea', 'name' => 'data[RegistrationPage][{{pageIndex}}][RegistrationQuestion][{{qIndex}}][description]', 'value' => null), ))); - //10 array_push($results, Hash::merge($results[$base], array( 'assert' => array('method' => 'assertInput', 'type' => 'input', 'name' => 'data[RegistrationPage][{{pageIndex}}][RegistrationQuestion][{{qIndex}}][is_choice_random]', 'value' => null), )));