View Issue Details

This bug affects 1 person(s).
 8
IDProjectCategoryView StatusLast Update
18464Bug reportsPluginspublic2023-05-19 13:37
Reporterbartoszm85 Assigned ToDenisChenu  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Product Version5.4.x 
Summary18464: Min/max settings doesn't work for question attribute with type of integer
Description

The plugin can add its own question attributes. If I add the question attribute with integer type, it doesn't recognize min/max settings and in the HTML generated view I can set the value beyond min/max. Min/max settings work for simple plugins settings but not for plugin question attributes.

TagsNo tags attached.
Bug heat8
Complete LimeSurvey version number (& build)5.3.x & 5.4.x
I will donate to the project if issue is resolvedNo
Browser
Database type & versiondoesn't matter
Server OS (if known)
Webserver software & version (if known)
PHP Versiondoesn't matter

Users monitoring this issue

DenisChenu

Activities

ollehar

ollehar

2022-11-07 11:41

administrator   ~72589

@DenisChenu something for you?

DenisChenu

DenisChenu

2022-11-07 11:43

developer   ~72592

Unsure ? I hate the new way of QuetsionAttribute system.
All must be rewritten currently.
Related to https://bugs.limesurvey.org/view.php?id=18428 ?

Else : sorry : this week a lot of work for client, some time delay.

I take a look this afternoon.

DenisChenu

DenisChenu

2022-11-07 11:44

developer   ~72593

@bartoszm85 can you send a sample plugin please ?

Just with a test settings, no need a working plugin.

DenisChenu

DenisChenu

2022-11-08 12:11

developer   ~72629

Not related to plugins

See file_upload question type

DenisChenu

DenisChenu

2022-11-08 12:11

developer   ~72630

DenisChenu

DenisChenu

2022-11-08 12:36

developer   ~72632

Min/max settings work for simple plugins settings but not for plugin question attributes.

????????????????????

DenisChenu

DenisChenu

2022-11-08 12:48

developer   ~72633

https://github.com/LimeSurvey/LimeSurvey/pull/2708

tibor.pacalat

tibor.pacalat

2023-05-17 15:52

administrator   ~75035

Hmm, validation is off here. I managed to input max:1 and min:4 and successfully create question (file upload type).

DenisChenu

DenisChenu

2023-05-17 16:42

developer   ~75037

Hmm, validation is off here.
What do you mean ?

I managed to input max:1 and min:4 and successfully create question (file upload type).

thee are no control like that , we only have min=1 for max file : https://github.com/LimeSurvey/LimeSurvey/blob/5482c09efa9a2be724fe7d76f6a577f070919909/application/views/survey/questions/answer/file_upload/config.xml#L181
And min=0 for min numbre of file : https://github.com/LimeSurvey/LimeSurvey/blob/5482c09efa9a2be724fe7d76f6a577f070919909/application/views/survey/questions/answer/file_upload/config.xml#L142

We don't have other control. and

  1. It's a totally new feature for QuestionTheme
  2. If it's used like that in FileUpload : it's a file upload issue
tibor.pacalat

tibor.pacalat

2023-05-17 17:00

administrator   ~75038

Please take a look at the video, this is when using bugs/18464_minmax_questionattribute.

DenisChenu

DenisChenu

2023-05-17 17:02

developer   ~75039

Yes and ?

It's not the issue here …

The minimal valus set for max file is set to 1, but you can set to -1 if you want.

There are NO other restriction then
min file to min to 0
max files to min to 1

DenisChenu

DenisChenu

2023-05-17 17:20

developer   ~75041

The issue was only for the settings set currently in config.xml

In 3.X : we can set min/max and the Administrator can not enter a different value.
It's not the case since 5X

minmax-3X-OK.gif (1,639,036 bytes)
minmax-5X-issue.gif (1,145,315 bytes)
DenisChenu

DenisChenu

2023-05-17 17:20

developer   ~75042

Last edited: 2023-05-17 17:21

Then : in current version : you can enter -1 and -1
After the fix: you can not enter 6& -1 , and not 0 in max number of files.

(on forum : someone enter 0, it's the reason i see the issue)

tibor.pacalat

tibor.pacalat

2023-05-19 11:48

administrator   ~75100

But you do realise that this doesn't make sense - to be able to set min > max? I see what you mean and what you fixed, but I think, since you already touched this part of code, that this extra validation makes sense as well.

DenisChenu

DenisChenu

2023-05-19 11:58

developer   ~75101

But you do realise that this doesn't make sense - to be able to set min > max? I see what you mean and what you fixed, but I think, since you already touched this part of code, that this extra validation makes sense as well.

No, config.xml are fixed, there are no way to use another settings in current config.xml system.

  1. Need another system than update HTML
  2. Need a way in config.xml to use other settings or logic system.

In 3.X : you can not set -1, in 5.X and 6.X : you can set -1. I only fix this issue …
The issue is this one : Min/max settings doesn't work for question attribute with type of integer : QuestionTheme can set min/max to fixed values : it was not used in 5.X.
Look at the issue description please …

Another issue was User can set min_files > max_files in upload question type
And then : need a new feature : Allow dynamic control on settings in config.xml

This is totally another issue here …

ping @ollehar

DenisChenu

DenisChenu

2023-05-19 12:01

developer   ~75102

@tibor.pacalat : you say to Gabriel on https://bugs.limesurvey.org/view.php?id=18495#c75099 «if the system wasn't designed to support this, this is clearly a feature request. Otherwise, it is a bug.»

The Question advanced settings system are NOT designed to allow to control min_files <= max_files

tibor.pacalat

tibor.pacalat

2023-05-19 12:22

administrator   ~75105

@DenisChenu thanks for your feedback, I agree with the things you pointed out.

tibor.pacalat

tibor.pacalat

2023-05-19 13:08

administrator   ~75109

Merged.

DenisChenu

DenisChenu

2023-05-19 13:37

developer   ~75111

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

DenisChenu

DenisChenu

2023-05-19 13:37

developer   ~75112

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

Related Changesets

LimeSurvey: master 2dd4f5c0

2023-05-19 13:07:49

DenisChenu


Committer: GitHub Details Diff
Fixed issue 18464: Min/max settings doesn't work for question attrib… (#2708)

* Fixed issue 18464: Min/max settings doesn't work for question attribute with type of integer
Dev: add the HTML attribute (clearly removed from code)

* Dev: add minimal comment
Affected Issues
18464
mod - application/extensions/AdvancedSettingWidget/views/integer.php Diff File
mod - application/models/QuestionAttribute.php Diff File

LimeSurvey: master 2dd4f5c0

2023-05-19 13:07:49

DenisChenu


Committer: GitHub Details Diff
Fixed issue 18464: Min/max settings doesn't work for question attrib… (#2708)

* Fixed issue 18464: Min/max settings doesn't work for question attribute with type of integer
Dev: add the HTML attribute (clearly removed from code)

* Dev: add minimal comment
Affected Issues
18464
mod - application/extensions/AdvancedSettingWidget/views/integer.php Diff File
mod - application/models/QuestionAttribute.php Diff File

Issue History

Date Modified Username Field Change
2022-11-06 16:59 bartoszm85 New Issue
2022-11-07 11:41 ollehar Priority none => normal
2022-11-07 11:41 ollehar Note Added: 72589
2022-11-07 11:41 ollehar Bug heat 0 => 2
2022-11-07 11:43 DenisChenu Note Added: 72592
2022-11-07 11:43 DenisChenu Bug heat 2 => 4
2022-11-07 11:44 DenisChenu Note Added: 72593
2022-11-07 11:44 DenisChenu Assigned To => DenisChenu
2022-11-07 11:44 DenisChenu Status new => feedback
2022-11-08 12:11 DenisChenu Status feedback => confirmed
2022-11-08 12:11 DenisChenu Note Added: 72629
2022-11-08 12:11 DenisChenu Note Added: 72630
2022-11-08 12:11 DenisChenu File Added: Capture d’écran du 2022-11-08 12-11-10.png
2022-11-08 12:12 DenisChenu Status confirmed => assigned
2022-11-08 12:36 DenisChenu Note Added: 72632
2022-11-08 12:36 DenisChenu Summary Min/max settings doesn't work for plugin added question attribute with type of integer => Min/max settings doesn't work for question attribute with type of integer
2022-11-08 12:47 DenisChenu Assigned To DenisChenu =>
2022-11-08 12:47 DenisChenu Status assigned => ready for code review
2022-11-08 12:48 DenisChenu Issue Monitored: DenisChenu
2022-11-08 12:48 DenisChenu Bug heat 4 => 6
2022-11-08 12:48 DenisChenu Note Added: 72633
2023-02-16 17:39 gabrieljenik Status ready for code review => ready for testing
2023-05-17 15:52 tibor.pacalat Note Added: 75035
2023-05-17 15:52 tibor.pacalat Bug heat 6 => 8
2023-05-17 16:42 DenisChenu Note Added: 75037
2023-05-17 17:00 tibor.pacalat Note Added: 75038
2023-05-17 17:00 tibor.pacalat File Added: Screen-2023-05-17-165902.mp4
2023-05-17 17:02 DenisChenu Note Added: 75039
2023-05-17 17:20 DenisChenu Note Added: 75041
2023-05-17 17:20 DenisChenu File Added: minmax-3X-OK.gif
2023-05-17 17:20 DenisChenu File Added: minmax-5X-issue.gif
2023-05-17 17:20 DenisChenu Note Added: 75042
2023-05-17 17:21 DenisChenu Note Edited: 75042
2023-05-19 11:48 tibor.pacalat Note Added: 75100
2023-05-19 11:58 DenisChenu Note Added: 75101
2023-05-19 12:01 DenisChenu Note Added: 75102
2023-05-19 12:22 tibor.pacalat Note Added: 75105
2023-05-19 13:08 tibor.pacalat Assigned To => tibor.pacalat
2023-05-19 13:08 tibor.pacalat Status ready for testing => closed
2023-05-19 13:08 tibor.pacalat Resolution open => fixed
2023-05-19 13:08 tibor.pacalat Note Added: 75109
2023-05-19 13:37 DenisChenu Changeset attached => LimeSurvey master 2dd4f5c0
2023-05-19 13:37 DenisChenu Note Added: 75111
2023-05-19 13:37 DenisChenu Changeset attached => LimeSurvey master 2dd4f5c0
2023-05-19 13:37 DenisChenu Note Added: 75112
2023-05-19 13:37 DenisChenu Assigned To tibor.pacalat => DenisChenu
2023-05-19 13:37 DenisChenu Assigned To tibor.pacalat => DenisChenu