View Issue Details

IDProjectCategoryView StatusLast Update
16488Bug reportsQuestion editorpublic2020-07-22 17:27
Reportergabrieljenik Assigned To 
PrioritynoneSeverityminor 
Status confirmedResolutionopen 
Product Version3.22.25 
Summary16488: Reviewing updateQuestionOrder usage
Description

On v4 we have noticed that sometimes question_order number is set following the survey_id.
That was due to a wrong usage of question::updateQuestionOrder() mehod and its parameters.

As the codebase for that seems similar on v3, review there if it used correctly and possible impacts

Additional Information

See application/controllers/admin/database.php::756

                    // if the group has changed then fix the sortorder of old and new group
                    Question::model()->updateQuestionOrder($oldgid, $iSurveyID);
TagsNo tags attached.
Complete LimeSurvey version number (& build)3.22.25
I will donate to the project if issue is resolvedNo
Browser
Database & DB-VersionMysql
Server OS (if known)
Webserver software & version (if known)
PHP Version7

Relationships

related to 16454 resolved Sometimes, question_order is assigned from survey_id 

Activities

gabrieljenik

gabrieljenik

2020-07-10 20:47

partner   ~58904

The method Question ::updateQuestionOrder() receives 3 args: gid, language, startPosition.
The database controller calls this method wrongly three times directly, passing the survey ID as second parameter (where it was supposed to be language), so those invocations have no effect, as the questions query returns no items.

At last, when moving questions in between groups (to a lower group), the database controller calls the function shiftOrderQuestions (which in turn calls updateQuestionOrder). That seems to be OK and seems to be the only point where it's required.

Should we remove those bad invocations?

Issue History

Date Modified Username Field Change
2020-07-10 20:09 gabrieljenik New Issue
2020-07-10 20:09 gabrieljenik Issue generated from: 16454
2020-07-10 20:09 gabrieljenik Relationship added related to 16454
2020-07-10 20:47 gabrieljenik Note Added: 58904
2020-07-22 17:27 sushmanadendla Status new => confirmed