View Issue Details

This issue affects 1 person(s).
 4
IDProjectCategoryView StatusLast Update
17350Bug reportsOtherpublic2022-06-03 15:04
Reporterollehar Assigned Togabrieljenik  
PrioritynoneSeverityminor 
Status closedResolutionfixed 
Product Version4.x.0-dev 
Summary17350: Question theme should be a separate database column, not an attribute
Description

To facilitate code like $question->question_theme using AR relations.

TagsNo tags attached.
Bug heat4
Complete LimeSurvey version number (& build)
I will donate to the project if issue is resolved
Browser
Database type & version
Server OS (if known)
Webserver software & version (if known)
PHP Version
Git branch / Pull Request URLN/A

Relationships

related to 17379 closedgabrieljenik Question types can be uninstalled 
related to 17380 assignedgabrieljenik Question theme has ambiguous columns 

Users monitoring this issue

There are no users monitoring this issue.

Activities

gabrieljenik

gabrieljenik

2021-06-11 15:49

developer   ~64877

To facilitate code like $question->question_theme using AR relations.

Is this really needed. This could be a really mess as the keys need to be moved from theme_names to numeric ids.
Can we just do question_theme as a column and leave the relationship for later?
Maybe adding a helper method that mimics the relationsip but not a "real one".
Or maybe see if we can make the relationship to be linked by theme name (alternative key).
But anyway, leave the relationship for later

What do you think?

ollehar

ollehar

2021-06-11 15:55

reporter   ~64878

Last edited: 2021-06-11 15:56

Can we just do question_theme as a column and leave the relationship for later?

The relation is automatic by Yii (kind of) as soon as you have the column. :)

lime_questions.question_theme_id --> id of question theme

Yeah, needs a db update to apply to all questions in installation. So might not be a very small fix.

Subquestions, when parent_id is set, should have question_theme_id NULL.

Adding a new column without using it doesn't make much sense, tho.

This is really how the original design should have been...

gabrieljenik

gabrieljenik

2021-06-11 16:01

developer   ~64879

well, it is not only that, what if Id changes from installation to installation. That will impact the export / import.
There could be other implications not known yet.

Honestly, feels better to do firt its own column, and then see best way to implement relationship.
How do you feel about that?

ollehar

ollehar

2021-06-11 16:03

reporter   ~64880

Good point! So maybe question_theme_name instead? Since name is unique too.

Honestly, feels better to do firt its own column, and then see best way to implement relationship

Not sure how you would split that task?

gabrieljenik

gabrieljenik

2021-06-11 16:06

developer   ~64881

Not sure how you would split that task?

Not sure, but first I will work on moving the attribute.
Then on reviewing how to use the relationship :)

ollehar

ollehar

2021-06-11 16:10

reporter   ~64882

In my head that's the same task. xD But have a look.

gabrieljenik

gabrieljenik

2021-06-23 16:37

developer   ~65023

Last edited: 2021-06-23 16:37

A first delivery: https://github.com/LimeSurvey/LimeSurvey/pull/1933

gabrieljenik

gabrieljenik

2021-08-09 22:51

developer   ~65893

Updated query used in update according to engine
https://github.com/LimeSurvey/LimeSurvey/pull/1999

gabrieljenik

gabrieljenik

2021-08-10 08:53

developer   ~65897

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

Related Changesets

LimeSurvey: master 71a1af66

2021-08-10 10:53

gabrieljenik

Committer: GitHub


Details Diff
Fixed issue #17350b: Update fails on pgsql and mssql after 17350 (#1999) Affected Issues
17350
mod - application/helpers/update/updatedb_helper.php Diff File
mod - application/models/QuestionTheme.php Diff File

Issue History

Date Modified Username Field Change
2021-06-02 17:59 ollehar New Issue
2021-06-02 18:02 ollehar Sync to Zoho Project Yes => |Yes|
2021-06-02 18:02 LimeBot Zoho Projects ID => 85781000000911001
2021-06-11 15:49 gabrieljenik Note Added: 64877
2021-06-11 15:55 ollehar Note Added: 64878
2021-06-11 15:56 ollehar Note Edited: 64878
2021-06-11 15:56 ollehar Note Edited: 64878
2021-06-11 16:01 gabrieljenik Note Added: 64879
2021-06-11 16:03 ollehar Note Added: 64880
2021-06-11 16:06 gabrieljenik Note Added: 64881
2021-06-11 16:10 ollehar Note Added: 64882
2021-06-11 16:10 ollehar Assigned To => gabrieljenik
2021-06-11 16:10 ollehar Status new => assigned
2021-06-22 14:47 gabrieljenik Issue cloned: 17379
2021-06-22 14:47 gabrieljenik Relationship added related to 17379
2021-06-22 14:57 gabrieljenik Issue cloned: 17380
2021-06-22 14:57 gabrieljenik Relationship added related to 17380
2021-06-23 16:37 gabrieljenik Note Added: 65023
2021-06-23 16:37 gabrieljenik Note Edited: 65023
2021-07-05 17:23 gabrieljenik Status assigned => ready for code review
2021-08-09 15:25 ollehar Status ready for code review => ready for testing
2021-08-09 22:51 gabrieljenik Note Added: 65893
2021-08-10 08:53 gabrieljenik Changeset attached => LimeSurvey master 71a1af66
2021-08-10 08:53 gabrieljenik Note Added: 65897
2021-08-10 08:53 gabrieljenik Resolution open => fixed
2021-08-13 15:13 ollehar Status ready for testing => resolved
2022-06-03 15:04 c_schmitz Status resolved => closed