View Issue Details

This bug affects 1 person(s).
 8
IDProjectCategoryView StatusLast Update
08065Bug reportsImport/Exportpublic2013-09-23 13:27
Reportermfaber Assigned Tomfaber  
PrioritynormalSeveritypartial_block 
Status closedResolutionfixed 
Product Version2.05 RC 
Fixed in Version2.00+ 
Summary08065: Custom answer code "0" is wrongly exported as ""
Description

When exporting survey results (csv/excel/etc.) and using a custom result code of 0 (zero) for either Yes or No, values will be 'missing' (empty) instead of 0 (zero).

So exporting a field with Yes/No and using '1' for Yes and '0' for No results in only '1' and missings.

Steps To Reproduce

Choose a survey with a YES/NO question and collected results
Use response export
choose Excel
choose Y->1, N->0
Export

TagsNo tags attached.
Bug heat8
Complete LimeSurvey version number (& build)130731
I will donate to the project if issue is resolvedNo
BrowserFF, Chrome
Database type & versionMySQL 5.0.10
Server OS (if known)Win7
Webserver software & version (if known)Apache/2.4.3 (Win32)
PHP VersionPhP 5.4.7

Relationships

related to 08039 closedmfaber Subquestion code '0' means trouble 

Users monitoring this issue

mfaber

Activities

mfaber

mfaber

2013-07-31 21:54

reporter   ~25902

can someone have a look and merge if ok? Thanks, M

Fix on github: https://github.com/LimeSurvey/LimeSurvey/pull/100

mfaber

mfaber

2013-07-31 21:56

reporter   ~25903

same procedure for master (2.0+) :)
https://github.com/LimeSurvey/LimeSurvey/pull/101

mfaber

mfaber

2013-07-31 22:05

reporter   ~25904

I'm afraid there might be more of those typing problems in the code.

Will now consider more often to use

"if (!isset($val))" instead of "if ($val)"
whenever appropriate to also catch $string='0' or $int=0

DenisChenu

DenisChenu

2013-08-11 19:29

developer   ~25952

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

mfaber

mfaber

2013-08-12 14:37

reporter   ~25984

Thanks for merging the pull request for the master branch. Can you also merge the one for 2.05?
https://github.com/LimeSurvey/LimeSurvey/pull/100

Thanks!
M

DenisChenu

DenisChenu

2013-08-20 19:39

developer   ~26030

Hi mfaber,

I can be in IRC tomorrow.

I think , it can be best if we use Yii.
In function returnGlobal
$urlParam=Yii::app()->request->getParam($stringname) give NULL if $stringname is not in $_REQUEST.

Then we have allways isset is same than is_nul here (because we set $urlparm).

Then change all
!$urlParam to !is_null($urlParam) seems OK for me ?
And it's more clear :).

(Same behaviour but more clean and explicit).

If you're OK: update your pull request for 2.05 (not needed for 2.0)

mfaber

mfaber

2013-08-20 23:43

reporter   ~26037

Hi Denis, I updated the PR...hope I understood you correctly. If not, feel free to reject the PR (no problem) and fix as you think it is appropriate. Thanks, M :)

DenisChenu

DenisChenu

2013-08-21 09:30

developer   ~26038

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

DenisChenu

DenisChenu

2013-08-21 09:47

developer   ~26040

Hi mfaber !

No, great.

The important think it's not if you do what i want, it's : what did you think of using is_null and not isset ?

c_schmitz

c_schmitz

2013-09-23 13:27

administrator   ~26326

Version 2.00+ Build 130923 released

Related Changesets

LimeSurvey: master 720370bf

2013-07-31 19:25:35

mfaber


Committer: mfaber Details Diff
Fixes issue 08065: Answer code conversion to '0'

DEV: when exporting to CSV/EXCEL etc. and conversion
DEV: of Y or N to '0' was chosen, values were wrongly
DEV: exported as 'missing values' (empty)
DEV:
DEV: nasty php typing problem....probably same problem
DEV: with issue 08039

Conflicts:
application/helpers/common_helper.php
Affected Issues
08065
mod - application/helpers/common_helper.php Diff File

LimeSurvey: 2.05 a55d4abc

2013-07-31 19:25:35

mfaber


Committer: mfaber Details Diff
Fixes issue 08065: Answer code conversion to '0'

DEV: when exporting to CSV/EXCEL etc. and conversion
DEV: of Y or N to '0' was chosen, values were wrongly
DEV: exported as 'missing values' (empty)
DEV:
DEV: nasty php typing problem....probably same problem
DEV: with issue 08039
Affected Issues
08039, 08065
mod - application/helpers/common_helper.php Diff File

LimeSurvey: master 3b89c86b

2013-08-11 17:28:56

DenisChenu

Details Diff
Merge pull request #101 from mfaber/zerovalue_master

Fixed issue 08065: Answer code conversion to '0'
Affected Issues
08065
mod - application/helpers/common_helper.php Diff File

LimeSurvey: 2.05 97fe3015

2013-08-21 07:30:11

DenisChenu

Details Diff
Merge pull request #100 from mfaber/zeroconversion

Fixed issue 08065: Answer code conversion to '0'
Affected Issues
08065
mod - application/helpers/common_helper.php Diff File

Issue History

Date Modified Username Field Change
2013-07-31 18:26 mfaber New Issue
2013-07-31 18:44 mfaber Relationship added related to 08039
2013-07-31 20:26 mfaber Assigned To => mfaber
2013-07-31 20:26 mfaber Status new => assigned
2013-07-31 21:53 mfaber Resolution open => fixed
2013-07-31 21:53 mfaber Fixed in Version => 2.00+
2013-07-31 21:54 mfaber Note Added: 25902
2013-07-31 21:56 mfaber Note Added: 25903
2013-07-31 22:05 mfaber Note Added: 25904
2013-08-11 19:29 mfaber Changeset attached => LimeSurvey master 720370bf
2013-08-11 19:29 DenisChenu Changeset attached => LimeSurvey master 3b89c86b
2013-08-11 19:29 DenisChenu Note Added: 25952
2013-08-12 14:33 mfaber Issue Monitored: mfaber
2013-08-12 14:37 mfaber Assigned To mfaber => DenisChenu
2013-08-12 14:37 mfaber Note Added: 25984
2013-08-20 19:39 DenisChenu Note Added: 26030
2013-08-20 23:43 mfaber Note Added: 26037
2013-08-21 09:30 mfaber Changeset attached => LimeSurvey 2.05 a55d4abc
2013-08-21 09:30 DenisChenu Changeset attached => LimeSurvey 2.05 97fe3015
2013-08-21 09:30 DenisChenu Note Added: 26038
2013-08-21 09:47 DenisChenu Note Added: 26040
2013-08-21 09:47 DenisChenu Status assigned => resolved
2013-08-21 09:47 DenisChenu Assigned To DenisChenu => mfaber
2013-09-23 13:27 c_schmitz Note Added: 26326
2013-09-23 13:27 c_schmitz Status resolved => closed
2021-08-02 19:35 guest Bug heat 6 => 8