View Issue Details

This bug affects 1 person(s).
 6
IDProjectCategoryView StatusLast Update
13103Bug reportsAssessmentspublic2018-01-15 10:35
ReporterTonisOrmisson Assigned Toollehar  
PrioritynoneSeverityminor 
Status closedResolutionfixed 
Product Version3.0.0-rc.x 
Summary13103: cannot enable assessment mode for survey
Description

CDbException

CDbCommand failed to execute the SQL statement: SQLSTATE[42000]: Syntax error or access violation: 1055 Expression #3 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'limesurvey.t.scope' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by. The SQL statement executed was: SELECT COUNT() FROM (SELECT FROM lime_assessments t WHERE sid=:ycp0 GROUP BY id) sq

/var/www/html/framework/db/CDbCommand.php(543)

531 {
532 if($this->_connection->enableProfiling)
533 Yii::endProfile('system.db.CDbCommand.query('.$this->getText().$par.')','system.db.CDbCommand.query');
534
535 $errorInfo=$e instanceof PDOException ? $e->errorInfo : null;
536 $message=$e->getMessage();
537 Yii::log(Yii::t('yii','CDbCommand::{method}() failed: {error}. The SQL statement executed was: {sql}.',
538 array('{method}'=>$method, '{error}'=>$message, '{sql}'=>$this->getText().$par)),CLogger::LEVEL_ERROR,'system.db.CDbCommand');
539
540 if(YII_DEBUG)
541 $message.='. The SQL statement executed was: '.$this->getText().$par;
542
543 throw new CDbException(Yii::t('yii','CDbCommand failed to execute the SQL statement: {error}',
544 array('{error}'=>$message)),(int)$e->getCode(),$errorInfo);
545 }
546 }
547
548 /*
549
Builds a SQL SELECT statement from the given query specification.
550 @param array $query the query specification in name-value pairs. The following
551
query options are supported: {@link select}, {@link distinct}, {@link from},
552 {@link where}, {@link join}, {@link group}, {@link having}, {@link order},
553
{@link limit}, {@link offset} and {@link union}.
554 @throws CDbException if "from" key is not present in given query parameter
555
@return string the SQL statement

Stack Trace
#0
+
/var/www/html/framework/db/CDbCommand.php(433): CDbCommand->queryInternal("fetchColumn", 0, array())
#1
+
/var/www/html/framework/db/ar/CActiveRecord.php(1609): CDbCommand->queryScalar()
#2
+
/var/www/html/framework/web/CActiveDataProvider.php(228): CActiveRecord->count(CDbCriteria)
#3
+
/var/www/html/framework/web/CDataProvider.php(224): CActiveDataProvider->calculateTotalItemCount()
#4
+
/var/www/html/framework/web/CActiveDataProvider.php(178): CDataProvider->getTotalItemCount()
#5
+
/var/www/html/framework/web/CDataProvider.php(168): CActiveDataProvider->fetchData()
#6
+
/var/www/html/framework/zii/widgets/CBaseListView.php(125): CDataProvider->getData()
#7
+
/var/www/html/framework/zii/widgets/grid/CGridView.php(339): CBaseListView->init()
#8

/var/www/html/application/extensions/bootstrap/widgets/TbGridView.php(44): CGridView->init()

39 /*
40
Initializes the widget.
41 */
42 public function init()
43 {
44 parent::init();
45 $classes = array('table');
46 if (isset($this->type) && !empty($this->type)) {
47 if (is_string($this->type)) {
48 $this->type = explode(' ', $this->type);
49 }

#9
+
/var/www/html/framework/web/CBaseController.php(147): TbGridView->init()
#10
+
/var/www/html/framework/web/CBaseController.php(181): CBaseController->createWidget("bootstrap.widgets.TbGridView", array("dataProvider" => CActiveDataProvider, "id" => "assessments-grid", "columns" => array(array("name" => "id", "filter" => false), array("name" => "buttons", "type" => "raw", "header" => "Action", "filter" => false), array("name" => "scope", "value" => "$data->scope == "G" ? eT("Global") : eT("Total")", "htmlOptions" => array("class" => "col-sm-1"), "filter" => "<select class="form-control" name="assessment["scope"]..."), array("name" => "name", "htmlOptions" => array("class" => "col-sm-2")), ...), "filter" => Assessment, ...))
#11

/var/www/html/application/views/admin/assessments/assessments_view.php(59): CBaseController->widget("bootstrap.widgets.TbGridView", array("dataProvider" => CActiveDataProvider, "id" => "assessments-grid", "columns" => array(array("name" => "id", "filter" => false), array("name" => "buttons", "type" => "raw", "header" => "Action", "filter" => false), array("name" => "scope", "value" => "$data->scope == "G" ? eT("Global") : eT("Total")", "htmlOptions" => array("class" => "col-sm-1"), "filter" => "<select class="form-control" name="assessment["scope"]..."), array("name" => "name", "htmlOptions" => array("class" => "col-sm-2")), ...), "filter" => Assessment, ...))

54 'itemsCssClass' => 'table table-responsive table-striped',
55 'htmlOptions'=>array('style'=>'cursor: pointer;', 'class'=>'hoverAction grid-view'),
56 'ajaxType' => 'POST',
57 'ajaxUpdate' => 'assessments-grid',
58 'template' => "{items}\n<div id='tokenListPager'><div class=\"col-sm-4\" id=\"massive-action-container\"></div><div class=\"col-sm-4 pager-container ls-ba \">{pager}</div><div class=\"col-sm-4 summary-container\">{summary}</div></div>",
59 'afterAjaxUpdate'=>'function(){ try{bindAction();} catch(e) {} }',
60 ));
61 ?>
62 </div>
63 </div>
64 <?php if ( Permission::model()->hasSurveyPermission($iSurveyID, 'assessments', 'create') ) { ?>

#12
+
/var/www/html/framework/web/CBaseController.php(126): require("/var/www/html/application/views/admin/assessments/assessments_vi...")
#13
+
/var/www/html/framework/web/CBaseController.php(95): CBaseController->renderInternal("/var/www/html/application/views/admin/assessments/assessments_vi...", array("surveyid" => "352985", "action" => "asessementactivate", "headings" => array("Scope", "Question group", "Minimum", "Maximum"), "groups" => array(4 => "G1 [G-1]"), ...), true)
#14
+
/var/www/html/framework/web/CController.php(872): CBaseController->renderFile("/var/www/html/application/views/admin/assessments/assessments_vi...", array("surveyid" => "352985", "action" => "asessementactivate", "headings" => array("Scope", "Question group", "Minimum", "Maximum"), "groups" => array(4 => "G1 [G-1]"), ...), true)
#15

/var/www/html/application/core/Survey_Common_Action.php(266): CController->renderPartial("/admin/assessments/assessments_view", array("surveyid" => "352985", "action" => "asessementactivate", "headings" => array("Scope", "Question group", "Minimum", "Maximum"), "groups" => array(4 => "G1 [G-1]"), ...), true)

261 // Load views
262 $content = "";
263 foreach ($aViewUrls as $sViewKey => $viewUrl) {
264 if (empty($sViewKey) || !in_array($sViewKey, array('message', 'output'))) {
265 if (is_numeric($sViewKey)) {
266 $content .= Yii::app()->getController()->renderPartial($sViewPath.$viewUrl, $aData, true);
267 } elseif (is_array($viewUrl)) {
268 foreach ($viewUrl as $aSubData) {
269 $aSubData = array_merge($aData, $aSubData);
270 $content .= Yii::app()->getController()->renderPartial($sViewPath.$sViewKey, $aSubData, true);
271 }

#16
+
/var/www/html/application/core/Survey_Common_Action.php(337): Survey_Common_Action->renderCentralContents("", array("assessments/assessments_view"), array("surveyid" => "352985", "action" => "asessementactivate", "headings" => array("Scope", "Question group", "Minimum", "Maximum"), "groups" => array(4 => "G1 [G-1]"), ...))
#17
+
/var/www/html/application/controllers/admin/assessments.php(97): Survey_Common_Action->_renderWrappedTemplate("", "assessments/assessments_view", array("surveyid" => "352985", "action" => "asessementactivate", "headings" => array("Scope", "Question group", "Minimum", "Maximum"), "groups" => array(4 => "G1 [G-1]"), ...), false)
#18
+
/var/www/html/application/controllers/admin/assessments.php(175): Assessments->_renderWrappedTemplate("", "assessments/assessments_view", array("surveyid" => "352985", "action" => "asessementactivate", "headings" => array("Scope", "Question group", "Minimum", "Maximum"), "groups" => array(4 => "G1 [G-1]"), ...))
#19
+
/var/www/html/application/controllers/admin/assessments.php(71): Assessments->_showAssessments("352985", "asessementactivate")
#20
unknown(0): Assessments->index("352985")
#21
+
/var/www/html/framework/web/actions/CAction.php(109): ReflectionMethod->invokeArgs(Assessments, array("352985"))
#22
+
/var/www/html/application/core/Survey_Common_Action.php(83): CAction->runWithParamsInternal(Assessments, ReflectionMethod, array("r" => "admin/assessments", "action" => "asessementactivate", "surveyid" => "352985", "iSurveyId" => "352985", ...))
#23
+
/var/www/html/framework/web/CController.php(308): Survey_Common_Action->runWithParams(array("r" => "admin/assessments", "action" => "asessementactivate", "surveyid" => "352985", "iSurveyId" => "352985", ...))
#24
+
/var/www/html/framework/web/CController.php(286): CController->runAction(Assessments)
#25
+
/var/www/html/framework/web/CController.php(265): CController->runActionWithFilters(Assessments, array())
#26
+
/var/www/html/application/controllers/AdminController.php(162): CController->run("assessments")
#27
+
/var/www/html/framework/web/CWebApplication.php(282): AdminController->run("assessments")
#28
+
/var/www/html/framework/web/CWebApplication.php(141): CWebApplication->runController("admin/assessments")
#29
+
/var/www/html/framework/base/CApplication.php(185): CWebApplication->processRequest()
#30
+
/var/www/html/index.php(195): CApplication->run()
2017-12-29 07:47:00 nginx/1.10.3 Yii Framework/1.1.18

TagsNo tags attached.
Bug heat6
Complete LimeSurvey version number (& build)Version 3.0.1
I will donate to the project if issue is resolvedNo
Browser
Database type & versionna
Server OS (if known)na
Webserver software & version (if known)na
PHP Versionna

Users monitoring this issue

There are no users monitoring this issue.

Activities

ollehar

ollehar

2017-12-29 11:10

administrator   ~45400

Cannot reproduce in the latest version, 3.0.1. Did you pull? Can you attach your survey, or give more detailed information about how to reproduce?

TonisOrmisson

TonisOrmisson

2017-12-29 18:59

developer   ~45411

I have the latest master from today. Rechecked just now.

I just stumbled on it.

import survey from the ls test folder:
tests/data/surveys/limesurvey_survey_352985.lss

go to assesments and try to activate assesment mode.

also while importing tests/data/surveys/limesurvey_survey_677328.lss I get
Internal Server Error
CDbCommand failed to execute the SQL statement: SQLSTATE[HY000]: General error: 1364 Field 'assessment_value' doesn't have a default value

running on:
https://hub.docker.com/r/tonisormisson/limesurvey-dev-xenial/

ollehar

ollehar

2018-01-08 10:44

administrator   ~45440

OK, will try again.

ollehar

ollehar

2018-01-08 11:03

administrator   ~45443

Cannot reproduce any issue. Is it a fresh install or an updated install?

TonisOrmisson

TonisOrmisson

2018-01-08 12:23

developer   ~45479

I run the installation process on docker:
https://github.com/TonisOrmisson/limesurvey-dev-xenial/blob/master/Dockerfile#L48
So its a new install

then run the docker image on a local volume of code.

Some db migration issue for me?

ollehar

ollehar

2018-01-09 11:42

administrator   ~45504

Are you using Postgres?

TonisOrmisson

TonisOrmisson

2018-01-09 13:02

developer   ~45511

no, mysql
https://github.com/TonisOrmisson/limesurvey-dev-xenial/blob/2dc846787a7334fc8e25618e33bdabac8de01a7c/Dockerfile#L47

c_schmitz

c_schmitz

2018-01-15 10:35

administrator   ~45610

Version 3.0.3 released.

Issue History

Date Modified Username Field Change
2017-12-29 08:50 TonisOrmisson New Issue
2017-12-29 11:10 ollehar Note Added: 45400
2017-12-29 11:10 ollehar Assigned To => ollehar
2017-12-29 11:10 ollehar Status new => feedback
2017-12-29 18:59 TonisOrmisson Note Added: 45411
2017-12-29 18:59 TonisOrmisson Status feedback => assigned
2018-01-08 10:44 ollehar Note Added: 45440
2018-01-08 11:03 ollehar Note Added: 45443
2018-01-08 11:03 ollehar Status assigned => feedback
2018-01-08 12:23 TonisOrmisson Note Added: 45479
2018-01-08 12:23 TonisOrmisson Status feedback => assigned
2018-01-09 11:42 ollehar Note Added: 45504
2018-01-09 11:42 ollehar Status assigned => resolved
2018-01-09 11:42 ollehar Resolution open => fixed
2018-01-09 13:02 TonisOrmisson Note Added: 45511
2018-01-15 10:35 c_schmitz Note Added: 45610
2018-01-15 10:35 c_schmitz Status resolved => closed