View Issue Details

This bug affects 1 person(s).
 6
IDProjectCategoryView StatusLast Update
18036Bug reportsConditionspublic2022-05-02 10:33
Reporterc_schmitz Assigned Togabrieljenik  
PrioritynormalSeveritycrash 
Status closedResolutionfixed 
Product Version5.3.x 
Summary18036: Database error when renumbering a scenario
Description

If more than one scenario was added and I want to change the scenario number and don't add a number I would get a database error.
Validation and proper error handling is missing here.

Steps To Reproduce

Steps to reproduce

Add two conditions to a question which each have a different scenario.
Click the button to edit the scenario number. The field for the new scenarion number is empty.
Don't enter a number, just save.

Expected result

I would expect to not be able to submit the empty scenario number or have the field default to the current scenario number.
Also I would expect it to be a number input field.

Actual result

I can submit and get a database error.
Stack trance

2022/04/12 17:14:30 [error] [exception.CDbException] CDbException:
CDbCommand ha riportato un errore nell'esecuzione della query SQL:
SQLSTATE[23000]: Integrity constraint violation: 1048 Column
'scenario' cannot be null in
/limesurvey/framework/db/CDbCommand.php:358
Stack trace:
#0
/limesurvey/framework/db/ar/CActiveRecord.php(1774):
CDbCommand->execute()
#1
/limesurvey/application/models/LSActiveRecord.php(240):
CActiveRecord->updateAll(Array, Object(CDbCriteria), Array)
#2
/limesurvey/application/models/Condition.php(149):
LSActiveRecord->updateAll(Array, Object(CDbCriteria))
#3
/limesurvey/application/controllers/admin/ConditionsAction.php(1188):
Condition->insertRecords(Array, true, Array)
#4
/limesurvey/application/controllers/admin/ConditionsAction.php(238):
ConditionsAction->applySubaction('updatescenario', Array)
#5 [internal function]: ConditionsAction->index('updatescenario',
617233, 369, 6489)
#6
/limesurvey/framework/web/actions/CAction.php(115):
ReflectionMethod->invokeArgs(Object(ConditionsAction), Array)
#7
/limesurvey/application/core/SurveyCommonAction.php(83):
CAction->runWithParamsInternal(Object(ConditionsAction),
Object(ReflectionMethod), Array)
#8
/limesurvey/framework/web/CController.php(308):
SurveyCommonAction->runWithParams(Array)
#9
/limesurvey/framework/web/CController.php(286):
CController->runAction(Object(ConditionsAction))
#10
/limesurvey/framework/web/CController.php(265):
CController->runActionWithFilters(Object(ConditionsAction), Array)
#11
/limesurvey/application/controllers/AdminController.php(226):
CController->run('conditions')
#12
/limesurvey/framework/web/CWebApplication.php(282):
AdminController->run('conditions')
#13
/limesurvey/framework/web/CWebApplication.php(141):
CWebApplication->runController('admin/condition...')
#14
/limesurvey/framework/base/CApplication.php(185):
CWebApplication->processRequest()
#15 /limesurvey/index.php(194):
CApplication->run()
#16 {main}

TagsNo tags attached.
Bug heat6
Complete LimeSurvey version number (& build)5.3.9 220411
I will donate to the project if issue is resolvedNo
Browser
Database type & versionn/a
Server OS (if known)
Webserver software & version (if known)
PHP Versionn/a

Users monitoring this issue

There are no users monitoring this issue.

Activities

galads

galads

2022-04-14 14:15

reporter   ~69074

First step: the scenario number field is empty when you click on update. The field should be prefilled with the current scenario number.

gabrieljenik

gabrieljenik

2022-04-14 20:46

manager   ~69086

PR: https://github.com/LimeSurvey/LimeSurvey/pull/2354

gabrieljenik

gabrieljenik

2022-05-02 07:57

manager   ~69325

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

LimeBot

LimeBot

2022-05-02 10:33

administrator   ~69331

Fixed in Release 5.3.12+220502

Related Changesets

LimeSurvey: master 30fef131

2022-05-02 07:57:55

gabrieljenik


Committer: GitHub Details Diff
Fixed issue 18036: Database error when renumbering a scenario (#2354)

Co-authored-by: encuestabizdevgit <devgit@encuesta.biz>
Affected Issues
18036
mod - application/controllers/admin/ConditionsAction.php Diff File
mod - application/views/admin/conditions/includes/conditions_scenario.php Diff File

Issue History

Date Modified Username Field Change
2022-04-14 14:08 c_schmitz New Issue
2022-04-14 14:11 c_schmitz Assigned To => gabrieljenik
2022-04-14 14:11 c_schmitz Status new => assigned
2022-04-14 14:15 galads Status assigned => confirmed
2022-04-14 14:15 galads Note Added: 69074
2022-04-14 14:15 galads Bug heat 0 => 2
2022-04-14 14:15 galads Priority none => normal
2022-04-14 20:46 gabrieljenik Note Added: 69086
2022-04-14 20:46 gabrieljenik Bug heat 2 => 4
2022-04-14 20:46 gabrieljenik Status confirmed => ready for testing
2022-05-02 07:57 gabrieljenik Changeset attached => LimeSurvey master 30fef131
2022-05-02 07:57 gabrieljenik Note Added: 69325
2022-05-02 07:57 gabrieljenik Resolution open => fixed
2022-05-02 10:33 LimeBot Note Added: 69331
2022-05-02 10:33 LimeBot Status ready for testing => closed
2022-05-02 10:33 LimeBot Bug heat 4 => 6