View Issue Details

This issue affects 1 person(s).
 6
IDProjectCategoryView StatusLast Update
17380Bug reportsOtherpublic2022-10-14 12:22
Reportergabrieljenik Assigned Togabrieljenik  
PrioritynoneSeverityminor 
Status assignedResolutionopen 
Product Version4.x.0-dev 
Summary17380: Question theme has ambiguous columns
Description

core_theme represents that is a theme delivered from LS.
Still, the name implies that it is a theme representing a plain question_type.

extends is overlapping with question_type. Probably should be a bool?

TagsNo tags attached.
Attached Files
image.png (12,266 bytes)   
image.png (12,266 bytes)   
Bug heat6
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 17350 closedgabrieljenik Question theme should be a separate database column, not an attribute 
related to 17411 closedc_schmitz No difference between Core questiontype and Question theme from core 

Users monitoring this issue

There are no users monitoring this issue.

Activities

ollehar

ollehar

2021-06-22 15:36

reporter   ~64975

core_theme should rather be theme_type, taking "core", "custom", and "user" as values.

ollehar

ollehar

2021-06-22 15:36

reporter   ~64976

Last edited: 2021-06-23 18:07

I think in some places in the code, it assumes core == 1 if extends == '' (empty string). So yeah. Needs to be reviewed.

gabrieljenik

gabrieljenik

2021-06-22 17:23

developer   ~64992

Last edited: 2021-06-23 18:07

core_theme should rather be theme_type, taking "core", "custom", and "user" as values.

I suggest just changing the name of the columns, rather than changing its data contents.
It will be a less impact change.

On the other side, what would be the difference in between "custom" and "user"?

ollehar

ollehar

2021-06-22 17:33

reporter   ~64993

Last edited: 2021-06-23 18:07

"custom" is built-in, inside the git repo BUT extending an existing theme. "user" is uploaded question theme, no in git repo.

ollehar

ollehar

2021-06-22 17:33

reporter   ~64994

Last edited: 2021-06-23 18:07

I suggest just changing the name of the columns, rather than changing its data contents.

Change to what?

gabrieljenik

gabrieljenik

2021-06-23 18:01

developer   ~65032

Last edited: 2021-06-23 18:07

core_theme -> standard

gabrieljenik

gabrieljenik

2021-06-23 18:03

developer   ~65033

Last edited: 2021-06-23 18:07

Joinning the change of name I would add these to the class:

/**
 * If a question theme doesn't extend any question type.
 * Ex: question types.
 */
public function isBase() 
{

}

/**
 * If a question theme does extend a quesiton type.
 * This can be a user generated one or created by Lime (Ex:bootstrap-buttons)
 */
public function isCustom() 
{

}

/**
 * If a question theme was created by Lime.
 */
public function isStandard() 
{

}

As well as new scopes for allowing better future usage

What do you think?

As per the extends column, the type should be reviewed, but I would do that on a different story

gabrieljenik

gabrieljenik

2021-12-07 15:36

developer   ~67734

Picking this up, this is our approach towards DB review.

Rename “theme_type” to "type", and its values should be recoded to differentiate base themes (aka question types) from extended themes.
Rename “core_theme” to “is_standard”.
Remove “extends”.

What do you think?
Do we have a go?

image-2.png (30,115 bytes)   
image-2.png (30,115 bytes)   
ollehar

ollehar

2021-12-07 15:37

reporter   ~67735

Remove "extends"?

gabrieljenik

gabrieljenik

2021-12-07 15:41

developer   ~67736

Remove "extends"?

Yes, is redundant.
It doesn't provide much information.

  • If this is a custom theme, it will always be extending something.
  • What would this extend? The question_type as you can't create new question types by extending.
galads

galads

2022-02-28 12:08

reporter   ~68421

Bad DB design. but is the column name "extends" used in the core queries? Will, it not break something?

ollehar

ollehar

2022-10-14 12:22

reporter   ~72253

To be updated after changes: https://manual.limesurvey.org/Database_documentation#question_themes

Issue History

Date Modified Username Field Change
2021-06-22 14:57 gabrieljenik New Issue
2021-06-22 14:57 gabrieljenik File Added: image.png
2021-06-22 14:57 gabrieljenik Issue generated from: 17350
2021-06-22 14:57 gabrieljenik Relationship added related to 17350
2021-06-22 15:36 ollehar Note Added: 64975
2021-06-22 15:36 ollehar Note Added: 64976
2021-06-22 15:36 ollehar Note Edited: 64976
2021-06-22 17:23 gabrieljenik Note Added: 64992
2021-06-22 17:33 ollehar Note Added: 64993
2021-06-22 17:33 ollehar Note Added: 64994
2021-06-23 18:01 gabrieljenik Note Added: 65032
2021-06-23 18:03 gabrieljenik Note Added: 65033
2021-06-23 18:07 gabrieljenik Assigned To => gabrieljenik
2021-06-23 18:07 gabrieljenik Status new => assigned
2021-06-23 18:07 LimeBot Zoho Projects ID => 85781000000987013
2021-12-07 15:36 gabrieljenik Note Added: 67734
2021-12-07 15:36 gabrieljenik File Added: image-2.png
2021-12-07 15:37 ollehar Note Added: 67735
2021-12-07 15:41 gabrieljenik Note Added: 67736
2022-02-28 12:08 galads Note Added: 68421
2022-06-01 00:51 gabrieljenik Relationship added related to 17411
2022-10-14 12:22 ollehar Note Added: 72253