- Posts: 409
- Thank you received: 34
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Error : Bad quota id with this survey id when creating a quota
- blocka
- Topic Author
- Offline
- Platinum Member
Less
More
4 months 2 weeks ago #253173
by blocka
Error : Bad quota id with this survey id when creating a quota was created by blocka
Please help us help you and fill where relevant:
Your LimeSurvey version: 5.6.48+231205
Own server or LimeSurvey hosting: Own
Survey theme/template: N/A
==================
When I try to add a quota to a survey, I get the error "Bad quota id with this survey id" .. I see this is triggered in Quotas.php:
But I'm not understanding why this error would occur?
Steps to recreate error:
Your LimeSurvey version: 5.6.48+231205
Own server or LimeSurvey hosting: Own
Survey theme/template: N/A
==================
When I try to add a quota to a survey, I get the error "Bad quota id with this survey id" .. I see this is triggered in Quotas.php:
Code:
/** * Check validity of a quotaid against a survey id * @param integer $iSurveyId * @param integer $quotaid * throw Exception * @return void */ private function checkValidQuotaId($surveyId, $quotaId) { $model = Quota::model()->find( "id = :quotaid AND sid = :surveyid", [':quotaid' => $quotaId, ':surveyid' => $surveyId] ); if (empty($model)) { throw new CHttpException(403, gT("Bad quota id with this survey id.")); } }
But I'm not understanding why this error would occur?
Steps to recreate error:
- I create the the initial quota okay.
- I then click "Add answer".
- I select a Question and click Next
- I select an Answer and click Next
- The error Bad quota id with this survey id is displayed...
Please Log in to join the conversation.
- blocka
- Topic Author
- Offline
- Platinum Member
Less
More
- Posts: 409
- Thank you received: 34
4 months 2 weeks ago #253175
by blocka
Replied by blocka on topic Error : Bad quota id with this survey id when creating a quota
As an update to this, I noted that if I go to line 313 of /application/controllers/admin/Quotas.php/Quotas.php and comment out ...
$this->checkValidQuotaId($surveyId, $quota_id);
as shown below, the error does not occur. Note sure what else I'm breaking by commenting out this line though....
$this->checkValidQuotaId($surveyId, $quota_id);
as shown below, the error does not occur. Note sure what else I'm breaking by commenting out this line though....
Code:
public function insertquotaanswer(int $iSurveyId) { $this->requirePostRequest(); $iSurveyId = sanitize_int($iSurveyId); $qid = Yii::app()->request->getPost('quota_qid'); $quota_id = Yii::app()->request->getPost('quota_id'); $this->checkPermissions($iSurveyId, 'update'); //$this->checkValidQuotaId($surveyId, $quota_id);
Please Log in to join the conversation.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13648
- Thank you received: 2491
4 months 2 weeks ago #253298
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 : Bad quota id with this survey id when creating a quota
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.