View Issue Details

IDProjectCategoryView StatusLast Update
17249Bug reportsDatabase designpublic2021-04-15 15:58
Reporterollehar Assigned Toollehar  
PrioritynoneSeverityminor 
Status closedResolutionno change required 
Target Version4.x.0-dev 
Summary17249: Never use the boolean database type
DescriptionThey are implemented differently in MySQL and Postgres. Leads to troubles.

Two left in create-database.php:

installer/create-database.php: 'alwaysavailable' => "boolean NULL",
installer/create-database.php: 'core_theme' => 'boolean',
TagsNo tags attached.
Complete LimeSurvey version number (& build)latest master
I will donate to the project if issue is resolvedNo
Browser-
Database & DB-Version-
Server OS (if known)-
Webserver software & version (if known)-
PHP Version-

Activities

DenisChenu

DenisChenu

2021-04-15 15:34

developer   ~63961

Why you say it didn't woirk ?

I check alwaysavailable with pgsql i made test on mariadb and pgsql.
DenisChenu

DenisChenu

2021-04-15 15:35

developer   ~63962

And if you want to update to another type :
https://github.com/LimeSurvey/LimeSurvey/blob/3d035aa314973f4737036331c081f03af79914b5/application/core/db/PgsqlSchema.php#L17
seems the best way ?
No ?
ollehar

ollehar

2021-04-15 15:35

administrator   ~63963

Well, it's a character "t" or "f" in Postgres, so compare would be wrong.
ollehar

ollehar

2021-04-15 15:37

administrator   ~63964

Validation for question theme:

            array('owner_id, core_theme', 'numerical', 'integerOnly' => true),

Fails.
DenisChenu

DenisChenu

2021-04-15 15:40

developer   ~63965

alwaysavailable system work without issue with pgsql :/

tracevar($model->getAttributes());
DenisChenu

DenisChenu

2021-04-15 15:40

developer   ~63966

ollehar

ollehar

2021-04-15 15:41

administrator   ~63967

Let me check...
ollehar

ollehar

2021-04-15 15:43

administrator   ~63968

Last edited: 2021-04-15 15:43

View 2 revisions

```
array(23) {
  ["id"]=>
  int(1)
  ["name"]=>
  string(12) "5pointchoice"
  ["visible"]=>
  string(1) "Y"
  ["xml_path"]=>
  string(54) "application/views/survey/questions/answer/5pointchoice"
  ["image_path"]=>
  string(32) "/assets/images/screenshots/5.png"
  ["title"]=>
  string(14) "5 Point Choice"
  ["creation_date"]=>
  string(19) "2018-09-08 00:00:00"
  ["author"]=>
  string(12) "Dominik Vitt"
  ["author_email"]=>
  string(27) "dominik.vitt@limesurvey.org"
  ["author_url"]=>
  string(25) "http://www.limesurvey.org"
  ["copyright"]=>
  string(68) "Copyright (C) 2005 - 2018 LimeSurvey Gmbh, Inc. All rights reserved."
  ["license"]=>
  string(45) "GNU General Public License version 2 or later"
  ["version"]=>
  string(3) "1.0"
  ["api_version"]=>
  string(1) "1"
  ["description"]=>
  string(42) "5 point choice question type configuration"
  ["last_update"]=>
  string(19) "2019-09-23 15:05:59"
  ["owner_id"]=>
  int(1)
  ["theme_type"]=>
  string(14) "question_theme"
  ["question_type"]=>
  string(1) "5"
  ["core_theme"]=>
  bool(true)
  ["extends"]=>
  string(0) ""
  ["group"]=>
  string(23) "Single choice questions"
  ["settings"]=>
  string(107) "{"subquestions":"0","answerscales":"0","hasdefaultvalues":"0","assessable":"0","class":"choice-5-pt-radio"}"
}

```

core_theme = true
ollehar

ollehar

2021-04-15 15:43

administrator   ~63969

OK, so maybe enough to remove the validation rule for question attribute model?
DenisChenu

DenisChenu

2021-04-15 15:45

developer   ~63970

> OK, so maybe enough to remove the validation rule for question attribute model?

What is the validation ?

I use boolean for SurveysGroup model.
ollehar

ollehar

2021-04-15 15:45

administrator   ~63971

array('owner_id, core_theme', 'numerical', 'integerOnly' => true),

This is the validation. Testing with removing it.
DenisChenu

DenisChenu

2021-04-15 15:46

developer   ~63972

array('core_theme', 'boolan'),

If you use a boolean : it muts be a boolean : i don't see issue here …
ollehar

ollehar

2021-04-15 15:48

administrator   ~63973

Right.
ollehar

ollehar

2021-04-15 15:58

administrator   ~63974

Sorry for the noise. :|

Issue History

Date Modified Username Field Change
2021-04-15 15:20 ollehar New Issue
2021-04-15 15:21 ollehar Description Updated View Revisions
2021-04-15 15:34 DenisChenu Note Added: 63961
2021-04-15 15:35 DenisChenu Note Added: 63962
2021-04-15 15:35 ollehar Note Added: 63963
2021-04-15 15:37 ollehar Note Added: 63964
2021-04-15 15:40 DenisChenu Note Added: 63965
2021-04-15 15:40 DenisChenu File Added: Capture d’écran_2021-03-30_09-14-09.png
2021-04-15 15:40 DenisChenu File Added: Capture d’écran_2021-03-30_08-20-37.png
2021-04-15 15:40 DenisChenu File Deleted: Capture d’écran_2021-03-30_09-14-09.png
2021-04-15 15:40 DenisChenu File Deleted: Capture d’écran_2021-03-30_08-20-37.png
2021-04-15 15:40 DenisChenu Note Added: 63966
2021-04-15 15:40 DenisChenu File Added: Capture d’écran_2021-04-15_15-39-36.png
2021-04-15 15:40 DenisChenu File Added: Capture d’écran_2021-04-15_15-39-54.png
2021-04-15 15:41 ollehar Note Added: 63967
2021-04-15 15:43 ollehar Note Added: 63968
2021-04-15 15:43 ollehar Note Edited: 63968 View Revisions
2021-04-15 15:43 ollehar Note Added: 63969
2021-04-15 15:45 DenisChenu Note Added: 63970
2021-04-15 15:45 ollehar Note Added: 63971
2021-04-15 15:46 DenisChenu Note Added: 63972
2021-04-15 15:48 ollehar Note Added: 63973
2021-04-15 15:58 ollehar Assigned To => ollehar
2021-04-15 15:58 ollehar Status new => closed
2021-04-15 15:58 ollehar Resolution open => no change required
2021-04-15 15:58 ollehar Note Added: 63974