Navigation Menu

Skip to content

Commit

Permalink
Fixed issue : 500 error just after survey creation
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Shnoulle committed Jan 21, 2019
1 parent bfd9dd4 commit 2577e46
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions application/models/SurveymenuEntryData.php
Expand Up @@ -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;
Expand Down

0 comments on commit 2577e46

Please sign in to comment.