View Issue Details

IDProjectCategoryView StatusLast Update
17350Development Otherpublic2021-08-13 15:13
Reporterollehar Assigned Togabrieljenik  
PrioritynoneSeverityminor 
Status resolvedResolutionfixed 
Product Version4.x.0-dev 
Target Version4.x.0-dev 
Summary17350: Question theme should be a separate database column, not an attribute
DescriptionTo facilitate code like $question->question_theme using AR relations.
TagsNo tags attached.

Relationships

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

Users monitoring this issue

User List There are no users monitoring this issue.

Activities

gabrieljenik

gabrieljenik

2021-06-11 15:49

manager   ~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

administrator   ~64878

Last edited: 2021-06-11 15:56

View 3 revisions

> 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

manager   ~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

administrator   ~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

manager   ~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

administrator   ~64882

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

gabrieljenik

2021-06-23 16:37

manager   ~65023

Last edited: 2021-06-23 16:37

View 2 revisions

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

gabrieljenik

2021-08-09 22:51

manager   ~65893

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

gabrieljenik

2021-08-10 08:53

manager   ~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 08:53:31

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-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 View Revisions
2021-06-11 15:56 ollehar Note Edited: 64878 View Revisions
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 View Revisions
2021-07-05 17:23 gabrieljenik Status assigned => review
2021-08-09 15:25 ollehar Status review => 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 testing => resolved