Dependency Graph

Dependency Graph
related to related to child of child of duplicate of duplicate of

View Issue Details

This bug affects 1 person(s).
 24
IDProjectCategoryView StatusLast Update
17233Bug reportsSurvey takingpublic2021-07-12 11:53
Reporterollehar Assigned Toc_schmitz  
PrioritynormalSeveritypartial_block 
Status closedResolutionfixed 
Product Version4.4.15 
Target Version4.x.0-dev 
Summary17233: Question index is broken for the attached survey (postgres only)
Description

Title.

Steps To Reproduce
  1. Import lsa file
  2. Execute survey
  3. Click next to go to the second group
  4. Question index does nothing/can't use it to go back (or forward after you click "Previous" to go to the first group)
TagsNo tags attached.
Attached Files
Bug heat24
Complete LimeSurvey version number (& build)latest master
I will donate to the project if issue is resolvedNo
Browser-
Database type & versionpostgres 10
Server OS (if known)-
Webserver software & version (if known)-
PHP Version7.4

Relationships

has duplicate 17058 closedc_schmitz Access code length definition/inheritance not working anymore 

Activities

DenisChenu

DenisChenu

2021-04-08 15:21

developer   ~63869

But question index is not activated ?
It was inherited

I don't understand …

If you activate : it work

ollehar

ollehar

2021-04-08 15:51

administrator   ~63870

Last edited: 2021-04-12 12:11

Why is it visible if it's not activated? Maybe that's the issue?

DenisChenu

DenisChenu

2021-04-08 15:55

developer   ~63871

Last edited: 2021-04-12 12:11

I don't understand ,

On 4.4.16 from yesterday
I import the survey
Launch
Don't see index

Let me check with a new update

ollehar

ollehar

2021-04-08 15:55

administrator   ~63872

Last edited: 2021-04-12 12:11

Yeah? OK, maybe it's a fresh issue from today then (latest master).

DenisChenu

DenisChenu

2021-04-08 15:58

developer   ~63873

Last edited: 2021-04-12 12:11

$ git pull
Mise à jour 76f707d6f1..e48a95100a

Peek 08-04-2021 15-57.gif (384,658 bytes)
DenisChenu

DenisChenu

2021-04-08 15:58

developer   ~63874

Last edited: 2021-04-12 12:11

Last master … same

See screencast.

Caching issue ? Or maybe on Survey Group settings ?

ollehar

ollehar

2021-04-08 15:59

administrator   ~63875

Last edited: 2021-04-12 12:11

Let me import and test...

ollehar

ollehar

2021-04-08 16:02

administrator   ~63876

Last edited: 2021-04-12 12:11

Same issue at import. I'm using postgres, but that can't matter, can it? PHP 7.4

Selection_012.png (39,452 bytes)   
Selection_012.png (39,452 bytes)   
ollehar

ollehar

2021-04-08 16:06

administrator   ~63877

Last edited: 2021-04-12 12:11

Selection_013.png (94,075 bytes)   
Selection_013.png (94,075 bytes)   
DenisChenu

DenisChenu

2021-04-08 16:07

developer   ~63878

Last edited: 2021-04-12 12:11

OK : PG related

Same with Disabled forced on PG : see the index in twig.

PS : checking Navigation delay (seconds): iwith same survey

In PG : show -1
in Mariadb : show 0

DenisChenu

DenisChenu

2021-04-08 16:08

developer   ~63879

Last edited: 2021-04-12 12:11

DB driver : 12.6

DenisChenu

DenisChenu

2021-04-08 16:09

developer   ~63880

Last edited: 2021-04-12 12:11

(I always think usage of -1 is a bad idea for inherit … NULL is better)

ollehar

ollehar

2021-04-08 16:09

administrator   ~63881

Last edited: 2021-04-12 12:11

In PG : show -1
in Mariadb : show 0

Uh, why this discrepancy?

ollehar

ollehar

2021-04-08 16:24

administrator   ~63882

Last edited: 2021-04-12 12:11

Related to true/false?

DenisChenu

DenisChenu

2021-04-08 16:40

developer   ~63883

Last edited: 2021-04-12 12:11

-1 is not used for inherited ? and 0 for disable ?

ollehar

ollehar

2021-04-12 11:33

administrator   ~63910

Last edited: 2021-04-12 12:11

Might be relevant: https://stackoverflow.com/a/1942779/2138090

"The MySQL BOOLEAN (alias BOOL, alias TINYINT(1) ) is not compatible with the pg boolean type"

Basically, we should never use BOOL as a database type? But we aren't already?

c_schmitz

c_schmitz

2021-04-14 16:01

administrator   ~63938

It appears that the Postgres driver delivers real int values and some of the inheritance comparisons are too strict by comparing to string '-1'.

c_schmitz

c_schmitz

2021-04-14 16:03

administrator   ~63939

https://github.com/LimeSurvey/LimeSurvey/commit/bd0b4c1ef126401fbddbe272f01d6f15178633c3

c_schmitz

c_schmitz

2021-04-14 16:08

administrator   ~63940

17058 is a possible duplicate

DenisChenu

DenisChenu

2021-04-14 16:19

developer   ~63941

$instance->oOptions->{$attribute} == '-1' seems totally OK.

issue with == is more for false. And -1 is never false.

ollehar

ollehar

2021-04-15 11:53

administrator   ~63947

Last edited: 2021-04-15 11:54

Kind of solved by not using ===, but a better solution would be to fix the drivers around MySQL and Postgresql to behave the same, I guess.

Or make sure an attribute is either a string or an int, not randomly one or the other.

DenisChenu

DenisChenu

2021-04-15 13:31

developer   ~63952

a better solution would be to fix the drivers

Lol :

if ((empty($instance->oOptions->{$attribute})) || (!empty($instance->oOptions->{$attribute}) && ($instance->oOptions->{$attribute} === 'inherit' || $instance->oOptions->{$attribute} === 'I' || $instance->oOptions->{$attribute} == '-1'))) {

then : inherit is :

  • not set
  • ==='inherit'
  • ==='I'
  • =='-1'

Maybe start by "inherit" system fix

ollehar

ollehar

2021-04-15 13:44

administrator   ~63953

I have to admit I raised my eye brows...... Added to code quality guide as an example of a messy if-statement. :|

ollehar

ollehar

2021-04-15 13:44

administrator   ~63954

Should be wrapped in a method $attribute->isInherit();

DenisChenu

DenisChenu

2021-04-15 13:52

developer   ~63955

Should be wrapped in a method $attribute->isInherit();

Yes, and inherited value is set for each attribute :)

For example dropdown can easily use "" :)

But string and integer are better if it's null :(

c_schmitz

c_schmitz

2021-04-15 14:23

administrator   ~63956

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

c_schmitz

c_schmitz

2021-07-12 11:53

administrator   ~65279

Release done.

Related Changesets

LimeSurvey: master bd0b4c1e

2021-04-14 15:58:28

c_schmitz

Details Diff
Fixed issue 17233: Inheritance broken for some survey properties when using Postgres SQL Affected Issues
17233
mod - application/models/SurveysGroupsettings.php Diff File
mod - application/views/admin/survey/subview/accordion/_presentation_panel.php Diff File
mod - application/views/admin/survey/subview/accordion/_tokens_panel.php Diff File

Issue History

Date Modified Username Field Change
2021-04-08 14:22 ollehar New Issue
2021-04-08 14:22 ollehar File Added: survey_archive_277644.lsa
2021-04-08 14:23 ollehar Priority none => normal
2021-04-08 15:21 DenisChenu Note Added: 63869
2021-04-08 15:21 DenisChenu File Added: Capture d’écran_2021-04-08_15-21-09.png
2021-04-08 15:51 ollehar Note Added: 63870
2021-04-08 15:55 DenisChenu Note Added: 63871
2021-04-08 15:55 ollehar Note Added: 63872
2021-04-08 15:58 DenisChenu Note Added: 63873
2021-04-08 15:58 DenisChenu File Added: Peek 08-04-2021 15-57.gif
2021-04-08 15:58 DenisChenu Note Added: 63874
2021-04-08 15:59 ollehar Note Added: 63875
2021-04-08 16:02 ollehar Note Added: 63876
2021-04-08 16:02 ollehar File Added: Selection_012.png
2021-04-08 16:02 ollehar Database & DB-Version - => postgres 10
2021-04-08 16:02 ollehar PHP Version - => 7.4
2021-04-08 16:06 ollehar Note Added: 63877
2021-04-08 16:06 ollehar File Added: Selection_013.png
2021-04-08 16:07 DenisChenu Note Added: 63878
2021-04-08 16:07 DenisChenu File Added: Capture d’écran_2021-04-08_16-05-47.png
2021-04-08 16:08 DenisChenu Note Added: 63879
2021-04-08 16:08 DenisChenu File Added: Capture d’écran_2021-04-08_16-08-43.png
2021-04-08 16:09 DenisChenu Note Added: 63880
2021-04-08 16:09 ollehar Note Added: 63881
2021-04-08 16:24 ollehar Note Added: 63882
2021-04-08 16:40 DenisChenu Note Added: 63883
2021-04-08 17:30 ollehar Summary Question index is broken for the attached survey => Question index is broken for the attached survey (postgres only)
2021-04-12 11:17 c_schmitz Sync to Zoho Project => |Yes|
2021-04-12 11:33 ollehar Note Added: 63910
2021-04-12 12:03 c_schmitz Sync to Zoho Project Yes =>
2021-04-12 12:03 c_schmitz Sync to Zoho Project => |Yes|
2021-04-12 12:05 c_schmitz Sync to Zoho Project Yes =>
2021-04-12 12:05 c_schmitz Sync to Zoho Project => |Yes|
2021-04-12 12:06 c_schmitz Sync to Zoho Project Yes =>
2021-04-12 12:06 c_schmitz Sync to Zoho Project => |Yes|
2021-04-12 12:10 c_schmitz Sync to Zoho Project Yes =>
2021-04-12 12:11 c_schmitz Sync to Zoho Project => |Yes|
2021-04-12 12:11 c_schmitz Sync to Zoho Project Yes =>
2021-04-12 12:11 c_schmitz Sync to Zoho Project => |Yes|
2021-04-12 12:14 c_schmitz Assigned To => c_schmitz
2021-04-12 12:14 c_schmitz Status new => assigned
2021-04-14 15:59 c_schmitz Status assigned => ready for testing
2021-04-14 16:01 c_schmitz Note Added: 63938
2021-04-14 16:03 c_schmitz Note Added: 63939
2021-04-14 16:08 c_schmitz Relationship added related to 17058
2021-04-14 16:08 c_schmitz Note Added: 63940
2021-04-14 16:19 DenisChenu Note Added: 63941
2021-04-15 11:53 ollehar Status ready for testing => resolved
2021-04-15 11:53 ollehar Resolution open => fixed
2021-04-15 11:53 ollehar Note Added: 63947
2021-04-15 11:54 ollehar Note Edited: 63947
2021-04-15 13:05 c_schmitz Relationship replaced has duplicate 17058
2021-04-15 13:31 DenisChenu Note Added: 63952
2021-04-15 13:44 ollehar Note Added: 63953
2021-04-15 13:44 ollehar Note Added: 63954
2021-04-15 13:52 DenisChenu Note Added: 63955
2021-04-15 14:23 c_schmitz Changeset attached => LimeSurvey master bd0b4c1e
2021-04-15 14:23 c_schmitz Note Added: 63956
2021-07-12 11:53 c_schmitz Note Added: 65279
2021-07-12 11:53 c_schmitz Status resolved => closed