View Issue Details

This bug affects 1 person(s).
 4
IDProjectCategoryView StatusLast Update
16642Bug reportsSurvey takingpublic2020-10-12 09:28
ReporterMazi Assigned Togabrieljenik  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Product Version4.3.15 
Summary16642: PHP warning when showing array questions
Description

When opening a page with array questions I get a PHP warning, see screenshot.

Steps To Reproduce

Import the attached survey.
Start the survey with debug mode = 1.
At the first question page you should see a PHP warning.

TagsNo tags attached.
Attached Files
array_warning.png (45,915 bytes)   
array_warning.png (45,915 bytes)   
Bug heat4
Complete LimeSurvey version number (& build)Version 4.3.14+200826
I will donate to the project if issue is resolvedNo
BrowserChrome
Database type & versionMySQL 5
Server OS (if known)Ubuntu 20
Webserver software & version (if known)Apache
PHP Version7.3

Users monitoring this issue

There are no users monitoring this issue.

Activities

gabrieljenik

gabrieljenik

2020-10-01 14:32

manager   ~60018

For dual scale questions, the 'cellwidth' variable calculation involved the number of labels. But, the number of labels is only calculated when the question is shown as radios, and not when it's shown as dropdown.

However, fixing the 'cellwidth' calculation (diving by 1 when 'numrows' is not set) affected the rendering because the "answer_dropdown" view used the 'cellwidth' value for styling and it now changed from "INF" (infinity) to an actual number. So, the use of 'cellwidth' in dropdown view was removed in order to not alter how the question was rendered.

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

gabrieljenik

gabrieljenik

2020-10-07 19:42

manager   ~60110

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

lime_release_bot

lime_release_bot

2020-10-12 09:28

administrator   ~60149

Fixed in Release 4.3.20+201012

Related Changesets

LimeSurvey: master 0dab3a85

2020-10-07 19:42:18

gabrieljenik


Committer: GitHub Details Diff
Fixed issue 16642: PHP warning when showing array questions (#1608)

For dual scale questions, the 'cellwidth' variable calculation involved the number of labels. But, the number of labels is only calculated when the question is shown as radios, and not when it's shown as dropdown.

However, fixing the 'cellwidth' calculation (diving by 1 when 'numrows' is not set) affected the rendering because the "answer_dropdown" view used the 'cellwidth' value for styling and it now changed from "INF" (infinity) to an actual number. So, the use of 'cellwidth' in dropdown view was removed in order to not alter how the question was rendered.
Affected Issues
16642
mod - application/core/QuestionTypes/ArrayMultiscale/RenderArrayMultiscale.php Diff File
mod - application/views/survey/questions/answer/arrays/dualscale/answer_dropdown.twig Diff File

Issue History

Date Modified Username Field Change
2020-09-07 14:36 Mazi New Issue
2020-09-07 14:36 Mazi File Added: array_warning.png
2020-09-07 14:36 Mazi File Added: limesurvey_survey_595311.lss
2020-09-23 15:37 cdorin Assigned To => gabrieljenik
2020-09-23 15:37 cdorin Priority none => normal
2020-09-23 15:37 cdorin Status new => assigned
2020-09-23 15:37 cdorin Steps to Reproduce Updated
2020-09-23 15:37 cdorin Zoho Sprints => |Yes|
2020-10-01 14:32 gabrieljenik Note Added: 60018
2020-10-07 19:42 gabrieljenik Changeset attached => LimeSurvey master 0dab3a85
2020-10-07 19:42 gabrieljenik Note Added: 60110
2020-10-07 19:42 gabrieljenik Resolution open => fixed
2020-10-12 09:28 lime_release_bot Zoho Sprints Yes => |Yes|
2020-10-12 09:28 lime_release_bot Note Added: 60149
2020-10-12 09:28 lime_release_bot Status assigned => closed