From 2577e4673226b2a477ebeedaa8299d33eaf20f26 Mon Sep 17 00:00:00 2001 From: Denis Chenu Date: Mon, 21 Jan 2019 09:52:59 +0100 Subject: [PATCH] Fixed issue : 500 error just after survey creation Dev: QuestionGroup and its behaviors do not have a method or closure named "getByPk". Dev: and pk for QuestionGroup (and Question) in 3.X is an array --- application/models/SurveymenuEntryData.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/application/models/SurveymenuEntryData.php b/application/models/SurveymenuEntryData.php index b7518290f47..bb7780887b8 100644 --- a/application/models/SurveymenuEntryData.php +++ b/application/models/SurveymenuEntryData.php @@ -138,13 +138,13 @@ private function _getValueForLinkData($getDataPair) $oTypeObject = Template::model()->findByPk($oSurvey->template); break; case 'questiongroup': - if (isset($_REQUEST['gid'])) { - $oTypeObject = QuestionGroup::model()->getByPk(((int) $_REQUEST['gid'])); + if (App()->getRequest()->getParam('gid')) { + $oTypeObject = QuestionGroup::model()->findByPk(array('gid'=>App()->getRequest()->getParam('gid'),'language'=>App()->getLanguage())); } break; case 'question': - if (isset($_REQUEST['qid'])) { - $oTypeObject = QuestionGroup::model()->getByPk(((int) $_REQUEST['qid'])); + if (App()->getRequest()->getParam('qid')) { + $oTypeObject = QuestionGroup::model()->findByPk(array('gid'=>App()->getRequest()->getParam('qid'),'language'=>App()->getLanguage())); } break; break;