- Posts: 21
- Thank you received: 1
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Limesurvey 5.6.47 lime_questions does not have column "language"
- cgrewal94
- Topic Author
- Offline
- Junior Member
Less
More
5 months 2 days ago #253572
by cgrewal94
Limesurvey 5.6.47 lime_questions does not have column "language" was created by cgrewal94
Please help us help you and fill where relevant:
Your LimeSurvey version: 5.6.47
Own server or LimeSurvey hosting: Own server
Survey theme/template: Custom
==================
Hi there,
We have a custom plugin that stores the count of answer options in multi short text. It works fine in limesurvey 3.8 but in limesurvey 5 we encounter the error "Table lime_questions does not have a column name language".
Is there a workaround for this? I have attached an image of the error message.
Thanks!
Your LimeSurvey version: 5.6.47
Own server or LimeSurvey hosting: Own server
Survey theme/template: Custom
==================
Hi there,
We have a custom plugin that stores the count of answer options in multi short text. It works fine in limesurvey 3.8 but in limesurvey 5 we encounter the error "Table lime_questions does not have a column name language".
Is there a workaround for this? I have attached an image of the error message.
Thanks!
Please Log in to join the conversation.
- cgrewal94
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 21
- Thank you received: 1
5 months 2 days ago #253573
by cgrewal94
Replied by cgrewal94 on topic Limesurvey 5.6.47 lime_questions does not have column "language"
I believe I have found the function that has the issue. What things would I have to update in this function?
At a glance I can see that the "question" column does not exist in lime 5 as well.
At a glance I can see that the "question" column does not exist in lime 5 as well.
Code:
private function getSubQuestionsByQuestionId($qid, $language = "en") { $aBasicDestinationFields = \Question::model()->tableSchema->columnNames; array_push($aBasicDestinationFields, 'available_answers'); array_push($aBasicDestinationFields, 'subquestions'); array_push($aBasicDestinationFields, 'attributes'); array_push($aBasicDestinationFields, 'attributes_lang'); array_push($aBasicDestinationFields, 'answeroptions'); array_push($aBasicDestinationFields, 'defaultvalue'); if (!empty($aQuestionSettings)) { $aQuestionSettings = array_intersect($aQuestionSettings, $aBasicDestinationFields); } else { $aQuestionSettings = $aBasicDestinationFields; } if (empty($aQuestionSettings)) { return array('status' => 'No valid Data'); } $aResult = ; foreach ($aQuestionSettings as $sPropertyName) { if ($sPropertyName == 'available_answers' || $sPropertyName == 'subquestions') { $oSubQuestions = \Question::model()->findAllByAttributes(array( 'parent_qid' => $qid, 'language' => $language ), array('order' => 'title')); if (count($oSubQuestions) > 0) { $aData = array(); foreach ($oSubQuestions as $oSubQuestion) { if ($sPropertyName == 'available_answers') { $aData[$oSubQuestion['title']] = $oSubQuestion['question']; } else { $aData[$oSubQuestion['qid']]['title'] = $oSubQuestion['title']; $aData[$oSubQuestion['qid']]['question'] = $oSubQuestion['question']; $aData[$oSubQuestion['qid']]['scale_id'] = $oSubQuestion['scale_id']; } } $aResult[$sPropertyName] = $aData; } else { $aResult[$sPropertyName] = 'No available answers'; } } } return $aResult["subquestions"] ?? ; }
Please Log in to join the conversation.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13719
- Thank you received: 2503
5 months 1 day ago #253663
by DenisChenu
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic Limesurvey 5.6.47 lime_questions does not have column "language"
No workaround : you have to rewrite your plugin.
Or check version and do your request without language.
I move it to development section
Or check version and do your request without language.
I move it to development section
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Please Log in to join the conversation.