View Issue Details

This bug affects 1 person(s).
 6
IDProjectCategoryView StatusLast Update
16454Bug reportsQuestion editorpublic2020-10-26 08:16
Reportergabrieljenik Assigned Togabrieljenik  
PrioritynoneSeverityminor 
Status closedResolutionfixed 
Product Version4.2.7 
Summary16454: Sometimes, question_order is assigned from survey_id
Description

We have noticed that sometimes question_order number is set following the survey_id.

Additional Information

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

                        // Moving question to a 'lower' group
                        // insert question at the beginning of the destination group
                        Question::model()->updateQuestionOrder($this->iQuestionGroupID, $iSurveyID)
TagsNo tags attached.
Bug heat6
Complete LimeSurvey version number (& build)4.2.7
I will donate to the project if issue is resolvedNo
Browser
Database type & versionMysql
Server OS (if known)
Webserver software & version (if known)
PHP Version7

Relationships

related to 16334 closedgalads Condition editor: previous question not available 
related to 16488 closedgabrieljenik Reviewing updateQuestionOrder usage 
related to 16502 closedgabrieljenik Deprecated code in Database controller 

Users monitoring this issue

There are no users monitoring this issue.

Activities

gabrieljenik

gabrieljenik

2020-07-02 18:01

manager   ~58658

Last edited: 2020-07-10 21:14

This could happen on v3 as code is shared.
Created a ticket for v3: https://bugs.limesurvey.org/view.php?id=16488

DenisChenu

DenisChenu

2020-07-02 18:19

developer   ~58666

Last edited: 2020-07-17 16:33

In 3 : https://github.com/LimeSurvey/LimeSurvey/blob/4edbc0e8a804c72426f10ea101327d8f5667fa02/application/controllers/admin/database.php#L724

in 4 : https://github.com/LimeSurvey/LimeSurvey/blob/ee7db52e3ab48535493b0ff7401ab74703e180ff/application/controllers/admin/database.php#L746

Not the same , right ?

gabrieljenik

gabrieljenik

2020-07-07 16:11

manager   ~58752

Last edited: 2020-07-17 16:33

No, not the same. But we have identified some code on v4 which wrongly used updateQuestionOrder() which was very old.
I will update on this later as we have found some dead code.
Also we have found the method wrongly called on v3 which made the method to do nothing.

Will update later

gabrieljenik

gabrieljenik

2020-07-10 20:49

manager   ~58905

Last edited: 2020-07-17 16:33

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

On v4, we found "database::actionUpdateQuestion()" to be deprecated. Should it be removed?

gabrieljenik

gabrieljenik

2020-10-23 10:22

manager   ~60387

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

DenisChenu

DenisChenu

2020-10-23 10:56

developer   ~60388

On v4, we found "database::actionUpdateQuestion()" to be deprecated. Should it be removed?

yes ! or at minima put phpDoc @deprecated since .

lime_release_bot

lime_release_bot

2020-10-26 08:16

administrator   ~60405

Fixed in Release 4.3.23+201026

Related Changesets

LimeSurvey: master ac15ca87

2020-07-10 21:56

gabrieljenik


Details Diff
Fixed issue 16454: Sometimes, question_order is assigned from survey_id

When deleting a question, the order of questions in the group were reassigned by calling updateQuestionOrder, but the survey ID was passed as starting position.
Affected Issues
16454
mod - application/models/Question.php Diff File

LimeSurvey: master 1b975c60

2020-07-10 21:57

gabrieljenik


Details Diff
Fixed issue 16454: Sometimes, question_order is assigned from survey_id

updateQuestionOrder definition was modified to use 1 as default value. Now reordering will follow the same schema as when questions are added, both starting from 1.
Affected Issues
16454
mod - application/models/Question.php Diff File

LimeSurvey: master 078fd368

2020-10-23 12:22

ollehar

Committer: GitHub


Details Diff
Fixed issue 16454: Sometimes, question_order is assigned from survey_id

Merge pull request #1482 from gabrieljenik/bug/16454-Sometimes,-question_order-is-assigned-from-survey_id
Affected Issues
16454
mod - application/models/Question.php Diff File

Issue History

Date Modified Username Field Change
2020-07-02 17:59 gabrieljenik New Issue
2020-07-02 17:59 gabrieljenik Relationship added related to 16334
2020-07-02 18:01 gabrieljenik Additional Information Updated
2020-07-02 18:01 gabrieljenik Note Added: 58658
2020-07-02 18:19 DenisChenu Note Added: 58666
2020-07-03 11:04 ollehar Product Version => 4.2.7
2020-07-06 11:43 cdorin Status new => confirmed
2020-07-06 11:43 cdorin Zoho Sprints => |Yes|
2020-07-06 11:43 swendrich Zoho Sprints ID => 14469000000166001
2020-07-07 16:11 gabrieljenik Note Added: 58752
2020-07-10 20:09 gabrieljenik Issue cloned: 16488
2020-07-10 20:09 gabrieljenik Relationship added related to 16488
2020-07-10 20:49 gabrieljenik Note Added: 58905
2020-07-10 21:14 gabrieljenik Note Edited: 58905
2020-07-10 21:14 gabrieljenik Note Edited: 58658
2020-07-16 23:44 gabrieljenik Relationship added related to 16502
2020-07-17 16:33 swendrich Zoho Sprints Yes => |Yes|
2020-07-17 16:33 swendrich Status confirmed => resolved
2020-10-23 10:22 ollehar Changeset attached => LimeSurvey master 078fd368
2020-10-23 10:22 gabrieljenik Changeset attached => LimeSurvey master 1b975c60
2020-10-23 10:22 gabrieljenik Changeset attached => LimeSurvey master ac15ca87
2020-10-23 10:22 gabrieljenik Note Added: 60387
2020-10-23 10:22 gabrieljenik Assigned To => gabrieljenik
2020-10-23 10:22 gabrieljenik Resolution open => fixed
2020-10-23 10:56 DenisChenu Note Added: 60388
2020-10-26 08:16 lime_release_bot Zoho Sprints Yes => |Yes|
2020-10-26 08:16 lime_release_bot Note Added: 60405
2020-10-26 08:16 lime_release_bot Status resolved => closed