View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
04697 | Bug reports | Survey taking | public | 2010-10-25 16:14 | 2010-10-28 00:54 |
Reporter | ronvdburg | Assigned To | c_schmitz | ||
Priority | normal | Severity | minor | ||
Status | closed | Resolution | fixed | ||
Product Version | 1.90+ | ||||
Fixed in Version | 1.90+ | ||||
Summary | 04697: PHP Warning at submit with show-empty-group | ||||
Description | If submitting a survey in group mode; | ||||
Steps To Reproduce | Select/create a survey in group mode. Select/create the last group. Start the survey. You will now see an "empty group" page because the last group is not shown. Press submit. Check the error_log. | ||||
Additional Information | The PHP in-array function complains if the second argument is empty. So, replace In other words, check if there are postedfieldnames before trying to use them. In my uploaded patch, I also moved the end-of-line comment to the next line. Otherwise the code is longer than 80 characters. | ||||
Tags | No tags attached. | ||||
Attached Files | in_array.patch (1,011 bytes)
Index: limesurvey/save.php =================================================================== --- limesurvey/save.php (revision 9333) +++ limesurvey/save.php (working copy) @@ -434,8 +434,9 @@ { $_SESSION[$value]=sanitize_float($_SESSION[$value]); } - elseif ($fieldexists['type']=='D' && in_array($value,$postedfieldnames)) // convert the date to the right DB Format but only if it was posted + elseif ($fieldexists['type']=='D' && sizeof($postedfieldnames) > 0 && in_array($value,$postedfieldnames)) { + // convert the date to the right DB Format but only if it was posted $dateformatdatat=getDateFormatData($thissurvey['surveyls_dateformat']); $datetimeobj = new Date_Time_Converter($_SESSION[$value], $dateformatdatat['phpdate']); $_SESSION[$value]=$datetimeobj->convert("Y-m-d"); | ||||
Bug heat | 2 | ||||
Complete LimeSurvey version number (& build) | 9333 | ||||
I will donate to the project if issue is resolved | |||||
Browser | |||||
Database type & version | mysql 5.0.77 | ||||
Server OS (if known) | Centos 5.3 / Linux 2.6.18 | ||||
Webserver software & version (if known) | apache 2.2.3 | ||||
PHP Version | 5.1.6 | ||||
Date Modified | Username | Field | Change |
---|---|---|---|
2010-10-25 16:14 | ronvdburg | New Issue | |
2010-10-25 16:14 | ronvdburg | File Added: in_array.patch | |
2010-10-25 17:14 | c_schmitz | Assigned To | => c_schmitz |
2010-10-25 17:14 | c_schmitz | Status | new => assigned |
2010-10-25 17:23 | c_schmitz | Note Added: 13341 | |
2010-10-25 17:23 | c_schmitz | Status | assigned => resolved |
2010-10-25 17:23 | c_schmitz | Fixed in Version | => 1.90+ |
2010-10-25 17:23 | c_schmitz | Resolution | open => fixed |
2010-10-25 17:24 | c_schmitz | Note Edited: 13341 | |
2010-10-28 00:54 | c_schmitz | Note Added: 13357 | |
2010-10-28 00:54 | c_schmitz | Status | resolved => closed |