View Issue Details

IDProjectCategoryView StatusLast Update
16364Bug reportsSurvey editingpublic2020-06-08 11:49
Reportermfrankiewicz Assigned To 
PrioritynoneSeveritypartial_block 
Status closedResolutionfixed 
Product Version4.2.4 
Fixed in Version4.2.x 
Summary16364: Problem with saving default value for question
Description

2020/06/05 08:51:30 [error] [exception.CException] CException: Property "DefaultValue.defaultvalue" is not defined. in /framework/base/CComponent.php:130
Stack trace:
#0 /framework/db/ar/CActiveRecord.php(145): CComponent->__get('defaultvalue')
#1 /application/core/LSYii_Validators.php(59): CActiveRecord->__get('defaultvalue')
#2 /framework/validators/CValidator.php(201): LSYii_Validators->validateAttribute(Object(DefaultValue), 'defaultvalue')
#3 /framework/base/CModel.php(159): CValidator->validate(Object(DefaultValue), Array)
#4 /framework/db/ar/CActiveRecord.php(810): CModel->validate(NULL)
#5 /application/controllers/admin/database.php(189): CActiveRecord->save()
#6 /application/controllers/admin/database.php(279): database->_updateDefaultValues(XXX, 0, 0, '', 'pl', 'XXX')
#7 /application/controllers/admin/database.php(122): database->actionUpdateDefaultValues(XXX)
#8 [internal function]: database->index()
#9 /framework/web/actions/CAction.php(109): ReflectionMethod->invokeArgs(Object(database), Array)
#10 /application/core/Survey_Common_Action.php(86): CAction->runWithParamsInternal(Object(database), Object(ReflectionMethod), Array)
#11 /framework/web/CController.php(308): Survey_Common_Action->runWithParams(Array)
#12 /framework/web/CController.php(286): CController->runAction(Object(database))
#13 /framework/web/CController.php(265): CController->runActionWithFilters(Object(database), Array)
#14 /application/controllers/AdminController.php(180): CController->run('database')
#15 /framework/web/CWebApplication.php(282): AdminController->run('database')
#16 /framework/web/CWebApplication.php(141): CWebApplication->runController('admin/database/...')
#17 /framework/base/CApplication.php(185): CWebApplication->processRequest()
#18 /index.php(182): CApplication->run()
#19 {main}

Steps To Reproduce
  1. login as NON SUPERADMIN user
  2. go to survey -> questions -> select any question -> edit default values
  3. try to save anything
  4. you get 500 internal error
Additional Information

There is a problem with defaultvalue validator assigned to DefaultValue model, this model does not have that field. Error occurs only on non superadmin accounts because of condition in LSYii_Validators::validateAttribute that applies xss filter on validated value only for normal users. That xss filter tries to get defaultvalue field from DefaultValue model, but that field does not exist.

This error occurs also on 4.2.4+ versions.

TagsNo tags attached.
Complete LimeSurvey version number (& build)4.2.4+200520
I will donate to the project if issue is resolvedNo
Browser
Database & DB-Version10.0.38-MariaDB
Server OS (if known)
Webserver software & version (if known)
PHP Version7.1

Activities

guest

guest

2020-06-05 10:30

viewer   ~58189

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

lime_release_bot

lime_release_bot

2020-06-08 11:49

administrator   ~58217

Fixed in Release 4.2.8+200608

Related Changesets

LimeSurvey: master 722fd5a7

2020-06-05 10:30:45

mfrankiewicz


Committer: GitHub Details Diff
Fixed issue 16364: validator assigned to non existent field (#1430) Affected Issues
16364
mod - application/models/DefaultValue.php Diff File

Issue History

Date Modified Username Field Change
2020-06-05 09:12 mfrankiewicz New Issue
2020-06-05 10:30 mfrankiewicz Changeset attached => LimeSurvey master 722fd5a7
2020-06-05 10:30 guest Note Added: 58189
2020-06-05 14:12 ollehar Status new => resolved
2020-06-05 14:12 ollehar Resolution open => fixed
2020-06-05 14:12 ollehar Fixed in Version => 4.2.x
2020-06-08 11:49 lime_release_bot Note Added: 58217
2020-06-08 11:49 lime_release_bot Status resolved => closed