View Issue Details

This bug affects 1 person(s).
 6
IDProjectCategoryView StatusLast Update
13422Bug reportsSurvey editingpublic2018-03-15 13:40
Reportercmcsilvaster Assigned Tomarkusfluer 
PrioritynoneSeverityblock 
Status closedResolutionfixed 
Product Version3.1.x 
Fixed in Version3.5.x 
Summary13422: Dropdown menu in portuguese internal server error
Description

When the ADMIN language is set to portuguese (My personal settings) and you try to create a new survey and add a dropdown question originate a INTERNAL SERVER ERROR .Question is corrupt: no type defined for question

Steps To Reproduce

put ADMIN language to portuguese;
create a survey;
create a group of questions;
add a question;
single choice question (perguntas com escolha única);
Dropdown (lista de seleção)

TagsNo tags attached.
Attached Files
1.JPG (42,198 bytes)   
1.JPG (42,198 bytes)   
2.JPG (45,844 bytes)   
2.JPG (45,844 bytes)   
Bug heat6
Complete LimeSurvey version number (& build)Any but test on 3.4.2+180223
I will donate to the project if issue is resolvedNo
Browserany
Database type & versionxampp version 5.6.8
Server OS (if known)windows 7 pro
Webserver software & version (if known)xampp version 5.6.8
PHP Versionxampp version 5.6.8

Users monitoring this issue

There are no users monitoring this issue.

Activities

ollehar

ollehar

2018-02-27 14:19

administrator   ~46787

Cannot reproduce. Can you please set debug => 2 in config.php and try again? Then give us the complete error message.

cmcsilvaster

cmcsilvaster

2018-02-28 10:19

reporter   ~46812

CException

Question is corrupt: no type defined for question 10

C:\xampp\htdocs\application\models\QuestionAttribute.php(188)

176
177 if ($oQuestion) {
178 if ($sLanguage) {
179 $aLanguages = array($sLanguage);
180 } else {
181 $aLanguages = array_merge(array(Survey::model()->findByPk($oQuestion->sid)->language), Survey::model()->findByPk($oQuestion->sid)->additionalLanguages);
182 }
183 // Get all atribute set for this question
184 $sType = $oQuestion->type;
185
186 // For some reason this happened in bug #10684
187 if ($sType == null) {
188 throw new \CException("Question is corrupt: no type defined for question ".$iQuestionID);
189 }
190
191 $aAttributeNames = \LimeSurvey\Helpers\questionHelper::getQuestionAttributesSettings($sType);
192
193 / Get whole existing attribute for this question in an array/
194 $oAttributeValues = QuestionAttribute::model()->findAll("qid=:qid", array('qid'=>$iQuestionID));
195
196 foreach ($oAttributeValues as $oAttributeValue) {
197 if ($oAttributeValue->attribute == 'question_template') {
198 $aAttributeValues['question_template'] = $oAttributeValue->value;
199 $aAttributeNames = Question::getQuestionTemplateAttributes($aAttributeNames, $aAttributeValues, $oQuestion);
200 break;

Stack Trace
#0

C:\xampp\htdocs\application\models\Question.php(237): QuestionAttribute->getQuestionAttributes("10", "pt")

232 if (is_null($sLanguage)) {
233 $aLanguages = array_merge(array(Survey::model()->findByPk($iSurveyID)->language), Survey::model()->findByPk($iSurveyID)->additionalLanguages);
234 } else {
235 $aLanguages = array($sLanguage);
236 }
237 $aAttributeValues = QuestionAttribute::model()->getQuestionAttributes($iQuestionID, $sLanguage);
238 // TODO: move getQuestionAttributesSettings() to QuestionAttribute model to avoid code duplication
239 $aAttributeNames = \LimeSurvey\Helpers\questionHelper::getQuestionAttributesSettings($sQuestionType);
240
241 // If the question has a custom template, we first check if it provides custom attributes
242

#1

C:\xampp\htdocs\application\controllers\admin\questions.php(81): Question->getAdvancedSettingsWithValues("10", "", 435212, "pt")

76 $aData['surveyid'] = $iSurveyID;
77 $aData['qid'] = $qid;
78 $aData['gid'] = $gid;
79 $aData['qrrow'] = $qrrow;
80 $aData['baselang'] = $baselang;
81 $aAttributesWithValues = Question::model()->getAdvancedSettingsWithValues($qid, $qrrow['type'], $iSurveyID, $baselang);
82 $DisplayArray = array();
83
84 foreach ($aAttributesWithValues as $aAttribute) {
85 if (($aAttribute['i18n'] == false && isset($aAttribute['value']) && $aAttribute['value'] != $aAttribute['default'])
86 || ($aAttribute['i18n'] == true && isset($aAttribute['value'][$baselang]) && $aAttribute['value'][$baselang] != $aAttribute['default'])) {

#2
unknown(0): questions->view("435212", "8", "10")
#3
+
C:\xampp\htdocs\framework\web\actions\CAction.php(109): ReflectionMethod->invokeArgs(questions, array("435212", "8", "10"))
#4

C:\xampp\htdocs\application\core\Survey_Common_Action.php(83): CAction->runWithParamsInternal(questions, ReflectionMethod, array("r" => "admin/questions/sa/view", "surveyid" => "435212", "gid" => "8", "qid" => "10", ...))

78 $oMethod = new ReflectionMethod($this, $sDefault);
79 }
80
81 // We're all good to go, let's execute it
82 // runWithParamsInternal would automatically get the parameters of the method and populate them as required with the params
83 return parent::runWithParamsInternal($this, $oMethod, $params);
84 }
85
86 /*
87
Some functions have different parameters, which are just an alias of the
88 * usual parameters we're getting in the url. This function just populates

#5
+
C:\xampp\htdocs\framework\web\CController.php(308): Survey_Common_Action->runWithParams(array("r" => "admin/questions/sa/view", "surveyid" => "435212", "gid" => "8", "qid" => "10", ...))
#6
+
C:\xampp\htdocs\framework\web\CController.php(286): CController->runAction(questions)
#7
+
C:\xampp\htdocs\framework\web\CController.php(265): CController->runActionWithFilters(questions, array())
#8
+
C:\xampp\htdocs\application\controllers\AdminController.php(158): CController->run("questions")
#9
+
C:\xampp\htdocs\framework\web\CWebApplication.php(282): AdminController->run("questions")
#10
+
C:\xampp\htdocs\framework\web\CWebApplication.php(141): CWebApplication->runController("admin/questions/sa/view")
#11
+
C:\xampp\htdocs\framework\base\CApplication.php(185): CWebApplication->processRequest()
#12
+
C:\xampp\htdocs\index.php(194): CApplication->run()
2018-02-28 10:16:26 Apache/2.4.12 (Win32) OpenSSL/1.0.1l PHP/5.6.8 Yii Framework/1.1.18

ollehar

ollehar

2018-02-28 10:38

administrator   ~46815

If you delete the question and then try to add it again, will it work?

By the way, why is the picture not working in your second screenshot? There should be a pic of the question type. Do you have any console errors (click F12 to inspect)? Which browser are you using?

cmcsilvaster

cmcsilvaster

2018-02-28 18:29

reporter   ~46845

I can't delete the question without delete the entire survey.
cause the survey crashes instantly.

about the others question, i send you 2 printscreens where is showed the output of the inspector and console, with Mozzila.
however its happen in IE and Chrome. So it is not a problem with the browser.

When the survey's language is ING this error doesn't happen....

And if

F12_console.png (179,462 bytes)
F12_inspector.png (180,450 bytes)
ollehar

ollehar

2018-03-01 16:12

administrator   ~46851

Can you export your survey file and upload it here, please?

It's also possible to delete questions from the question list view.

cmcsilvaster

cmcsilvaster

2018-03-02 19:04

reporter   ~46875

I can´t create a survey with a dropdown question.
If i insert a dropdown question give me a internal server error.
Regardless of what I do, I will never be able to access the survey again.
I will never be able to export the survey.

markusfluer

markusfluer

2018-03-12 15:54

administrator   ~47026

Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=26731

Related Changesets

LimeSurvey: master 4c3a14e3

2018-03-12 15:53:50

markusfluer

Details Diff
Fixed issue 13422: Dropdown menu in portuguese internal server error Affected Issues
13422
mod - application/views/admin/survey/Question/question_subviews/_question_type_select.php Diff File

Issue History

Date Modified Username Field Change
2018-02-27 12:50 cmcsilvaster New Issue
2018-02-27 12:50 cmcsilvaster File Added: 1.JPG
2018-02-27 12:50 cmcsilvaster File Added: 2.JPG
2018-02-27 14:19 ollehar Note Added: 46787
2018-02-27 14:19 ollehar Assigned To => ollehar
2018-02-27 14:19 ollehar Status new => feedback
2018-02-28 10:19 cmcsilvaster Note Added: 46812
2018-02-28 10:19 cmcsilvaster Status feedback => assigned
2018-02-28 10:38 ollehar Note Added: 46815
2018-02-28 10:38 ollehar Status assigned => feedback
2018-02-28 18:29 cmcsilvaster File Added: F12_console.png
2018-02-28 18:29 cmcsilvaster File Added: F12_inspector.png
2018-02-28 18:29 cmcsilvaster Note Added: 46845
2018-02-28 18:29 cmcsilvaster Status feedback => assigned
2018-03-01 16:12 ollehar Note Added: 46851
2018-03-01 16:13 ollehar Status assigned => feedback
2018-03-02 19:04 cmcsilvaster Note Added: 46875
2018-03-02 19:04 cmcsilvaster Status feedback => assigned
2018-03-06 12:04 ollehar Assigned To ollehar =>
2018-03-06 12:04 ollehar Status assigned => new
2018-03-12 15:54 markusfluer Changeset attached => LimeSurvey master 4c3a14e3
2018-03-12 15:54 markusfluer Note Added: 47026
2018-03-12 15:54 markusfluer Assigned To => markusfluer
2018-03-12 15:54 markusfluer Resolution open => fixed
2018-03-12 15:54 markusfluer Status new => resolved
2018-03-12 15:54 markusfluer Fixed in Version => 3.5.x
2018-03-15 13:40 ollehar Status resolved => closed
2019-11-01 17:25 c_schmitz Category Survey design => Survey editing