View Issue Details

IDProjectCategoryView StatusLast Update
15020User patchesSurvey designpublic2019-07-11 16:39
ReportersylmarcucciAssigned Toeddylackmann 
PrioritynoneSeveritycrash 
Status assignedResolutionopen 
Product Version 
Target VersionFixed in Version 
Summary15020: Error while creating a survey group.
Description

Hello,

After upgrading from 2.62 to 3.17 and trying new functionality "survey groups".
When creating new survey group and clicking on save button for this new group we get the following stack trace:

CException

La propriété « SurveysGroups.owner_uid » est indéfinie.

/nas/vol/limesurvey_qualif_1/www/qualif/framework/db/ar/CActiveRecord.php(162)

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)
158 {
159 if(isset($this->getMetaData()->relations[$name]))
160 $this->_related[$name]=$value;
161 else
162 parent::set($name,$value);
163 }
164 }
165
166 /*
167
Checks if a property value is null.
168 This method overrides the parent implementation by checking
169
if the named attribute is null or not.
170 @param string $name the property name or the event name
171
@return boolean whether the property value is null
172 */
173 public function
isset($name)
174 {

Stack Trace
#0
+
/nas/vol/limesurvey_qualif_1/www/qualif/framework/db/ar/CActiveRecord.php(162): CComponent->__set("owner_uid", "1")
#1

/nas/vol/limesurvey_qualif_1/www/qualif/application/controllers/admin/SurveysGroupsController.php(48): CActiveRecord->__set("owner_uid", "1")

43 // Uncomment the following line if AJAX validation is needed
44 // $this->performAjaxValidation($model);
45
46 if (Yii::app()->getRequest()->getPost('SurveysGroups')) {
47 $model->attributes = Yii::app()->getRequest()->getPost('SurveysGroups');
48 $model->created_by = $model->owner_uid = Yii::app()->user->id;
49 # $model->created_by = $model->owner_id = Yii::app()->user->id;
50 if ($model->save()) {
51 $this->getController()->redirect($this->getController()->createUrl('admin/survey/sa/listsurveys').'#surveygroups');
52 }
53 }

#2
unknown(0): SurveysGroupsController->create()
#3
+
/nas/vol/limesurvey_qualif_1/www/qualif/framework/web/actions/CAction.php(109): ReflectionMethod->invokeArgs(SurveysGroupsController, array())
#4

/nas/vol/limesurvey_qualif_1/www/qualif/application/core/Survey_Common_Action.php(83): CAction->runWithParamsInternal(SurveysGroupsController, ReflectionMethod, array("sa" => "create"))

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
+
/nas/vol/limesurvey_qualif_1/www/qualif/framework/web/CController.php(308): Survey_Common_Action->runWithParams(array("sa" => "create"))
#6
+
/nas/vol/limesurvey_qualif_1/www/qualif/framework/web/CController.php(286): CController->runAction(SurveysGroupsController)
#7
+
/nas/vol/limesurvey_qualif_1/www/qualif/framework/web/CController.php(265): CController->runActionWithFilters(SurveysGroupsController, array())
#8

/nas/vol/limesurvey_qualif_1/www/qualif/application/controllers/AdminController.php(158): CController->run("surveysgroups")

153 $this->redirect(array('/admin/authentication/sa/login'));
154 }
155 }
156 }
157
158 return parent::run($action);
159 }
160
161 /*
162
Routes all the actions to their respective places
163 *

#9
+
/nas/vol/limesurvey_qualif_1/www/qualif/framework/web/CWebApplication.php(282): AdminController->run("surveysgroups")
#10
+
/nas/vol/limesurvey_qualif_1/www/qualif/framework/web/CWebApplication.php(141): CWebApplication->runController("admin/surveysgroups/sa/create")
#11
+
/nas/vol/limesurvey_qualif_1/www/qualif/framework/base/CApplication.php(185): CWebApplication->processRequest()
#12
+
/nas/vol/limesurvey_qualif_1/www/qualif/index.php(194): CApplication->run()
2019-07-03 10:16:02 Apache/2.4.10 (Debian) Yii Framework/1.1.21

After investigating it seems that the problem is due to the following line of code in application/controllers/admin/SurveysGroupsController.php:

$model->created_by = $model->owner_uid = Yii::app()->user->id;

According to the table scheme the field owner_uid was renamed owner_id.
If we replace the code by :
$model->created_by = $model->owner_id = Yii::app()->user->id;

the survey group is successfully created.

Steps To Reproduce

Login in /admin
Go to surveys and surveys groups tab. Select create a new surveys group, fill required fields and submit the form by clicking the save button.

Additional Information

Debian version 8.11 amd64
PHP 5.6.40
MariaDB server 10.0.38

TagsNo tags attached.
Complete LimeSurvey version number (& build)Version 3.17.3+190429

Activities

LouisGac

LouisGac

2019-07-11 15:53

manager   ~52844

Eddy:

1st: try to reproduce with a 3.17 from git
2nd: if you can't reproduce, try by updating from 2.62 to latest stable.

eddylackmann

eddylackmann

2019-07-11 16:39

developer   ~52849

Can you please give me the buildnumber ? There are different builds of the version 3.17..

Issue History

Date Modified Username Field Change
2019-07-03 10:23 sylmarcucci New Issue
2019-07-11 15:52 LouisGac Assigned To => eddylackmann
2019-07-11 15:52 LouisGac Status new => assigned
2019-07-11 15:53 LouisGac Note Added: 52844
2019-07-11 16:39 eddylackmann Note Added: 52849