- Posts: 2
- Thank you received: 3
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Error with quota
- CDG47
- Topic Author
- Offline
- New Member
Less
More
4 years 1 month ago #194292
by CDG47
Error with quota was created by CDG47
When we try to add a quota, we have an error 500 : Property "Question.question" is not defined.
Code:
CException La propriété « Question.question » est indéfinie. /var/www/LimeSurvey-4.1.5-200217/framework/db/ar/CActiveRecord.php(145) 133 */ 134 public function __get($name) 135 { 136 if(isset($this->_attributes[$name])) 137 return $this->_attributes[$name]; 138 elseif(isset($this->getMetaData()->columns[$name])) 139 return null; 140 elseif(isset($this->_related[$name])) 141 return $this->_related[$name]; 142 elseif(isset($this->getMetaData()->relations[$name])) 143 return $this->getRelated($name); 144 else 145 return parent::__get($name); 146 } 147 148 /** 149 * PHP setter magic method. 150 * This method is overridden so that AR attributes can be accessed like properties. 151 * @param string $name property name 152 * @param mixed $value property value 153 * @throws CException 154 */ 155 public function __set($name,$value) 156 { 157 if($this->setAttribute($name,$value)===false) Stack Trace #0 + /var/www/LimeSurvey-4.1.5-200217/framework/db/ar/CActiveRecord.php(145): CComponent->__get("question") #1 + /var/www/LimeSurvey-4.1.5-200217/framework/base/CModel.php(596): CActiveRecord->__get("question") #2 – /var/www/LimeSurvey-4.1.5-200217/application/controllers/admin/quotas.php(521): CModel->offsetGet("question") 516 if ($aQuestionType == Question::QT_M_MULTIPLE_CHOICE) { 517 $aResults = Question::model()->findAllByAttributes(array('parent_qid' => $iQuestionId)); 518 $aAnswerList = array(); 519 520 foreach ($aResults as $aDbAnsList) { 521 $tmparrayans = array('Title' => $aQuestion['title'], 'Display' => substr($aDbAnsList['question'], 0, 40), 'code' => $aDbAnsList['title']); 522 $aAnswerList[$aDbAnsList['title']] = $tmparrayans; 523 } 524 } elseif ($aQuestionType == Question::QT_G_GENDER_DROPDOWN) { 525 $aAnswerList = array( 526 'M' => array('Title' => $aQuestion['title'], 'Display' => gT("Male"), 'code' => 'M'), #3 – /var/www/LimeSurvey-4.1.5-200217/application/controllers/admin/quotas.php(400): quotas->getQuotaAnswers("5978", "817198", "111") 395 } 396 397 if ($sSubAction == "new_answer_two" && isset($_POST['quota_qid']) && Permission::model()->hasSurveyPermission($iSurveyId, 'quotas', 'create')) { 398 $oQuestion = Question::model()->findByPk(array('qid' => Yii::app()->request->getPost('quota_qid'), 'language' => $oSurvey->language)); 399 400 $aQuestionAnswers = self::getQuotaAnswers(Yii::app()->request->getPost('quota_qid'), $iSurveyId, Yii::app()->request->getPost('quota_id')); 401 $x = 0; 402 403 foreach ($aQuestionAnswers as $aQACheck) { 404 if (isset($aQACheck['rowexists'])) { 405 $x++; #4 unknown(0): quotas->new_answer("817198", "new_answer_two") #5 + /var/www/LimeSurvey-4.1.5-200217/framework/web/actions/CAction.php(109): ReflectionMethod->invokeArgs(quotas, array("817198", "new_answer_two")) #6 – /var/www/LimeSurvey-4.1.5-200217/application/core/Survey_Common_Action.php(86): CAction->runWithParamsInternal(quotas, ReflectionMethod, array("surveyid" => "817198", "subaction" => "new_answer_two", "sa" => "new_answer", "iSurveyId" => "817198", ...)) 81 $oMethod = new ReflectionMethod($this, $sDefault); 82 } 83 84 // We're all good to go, let's execute it 85 // runWithParamsInternal would automatically get the parameters of the method and populate them as required with the params 86 return parent::runWithParamsInternal($this, $oMethod, $params); 87 } 88 89 /** 90 * Some functions have different parameters, which are just an alias of the 91 * usual parameters we're getting in the url. This function just populates #7 + /var/www/LimeSurvey-4.1.5-200217/framework/web/CController.php(308): Survey_Common_Action->runWithParams(array("surveyid" => "817198", "subaction" => "new_answer_two", "sa" => "new_answer", "iSurveyId" => "817198", ...)) #8 + /var/www/LimeSurvey-4.1.5-200217/framework/web/CController.php(286): CController->runAction(quotas) #9 + /var/www/LimeSurvey-4.1.5-200217/framework/web/CController.php(265): CController->runActionWithFilters(quotas, array()) #10 + /var/www/LimeSurvey-4.1.5-200217/application/controllers/AdminController.php(165): CController->run("quotas") #11 + /var/www/LimeSurvey-4.1.5-200217/framework/web/CWebApplication.php(282): AdminController->run("quotas") #12 + /var/www/LimeSurvey-4.1.5-200217/framework/web/CWebApplication.php(141): CWebApplication->runController("admin/quotas/sa/new_answer") #13 + /var/www/LimeSurvey-4.1.5-200217/framework/base/CApplication.php(185): CWebApplication->processRequest() #14 + /var/www/LimeSurvey-4.1.5-200217/index.php(195): CApplication->run()
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13935
- Thank you received: 2551
4 years 1 month ago #194351
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 Error with quota
Bug to be reported ?
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.
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10629
- Thank you received: 3696
4 years 1 month ago #194366
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Error with quota
In version 4.1.6, I can add a quota but get a server 500 error when trying to add an answer -
bugs.limesurvey.org/view.php?id=15902
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: DenisChenu, CDG47
The topic has been locked.