View Issue Details

This bug affects 1 person(s).
 8
IDProjectCategoryView StatusLast Update
06578Bug reportsInstallationpublic2012-09-28 15:44
Reporteruser21877Assigned Toc_schmitz  
PriorityhighSeveritypartial_block 
Status closedResolutionfixed 
Product Version2.00+ 
Fixed in Version2.00+ 
Summary06578: Saving settings
Description

This is a re-reporting of issue 6394


CDbException

CDbCommand failed to execute the SQL statement: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'stg_value' cannot be null. The SQL statement executed was: UPDATE lime_settings_global SET stg_name=:yp0, stg_value=:yp1 WHERE lime_settings_global.stg_name='emailsmtpssl'

C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\limesurvey\framework\db\CDbCommand.php(354))

I can confirm this is an issue with the latest version of LimeSurvey (downloaded this afternoon using the links on the download page). It's a clean fresh install, MySQL 5.1, Apache 2.2, PHP 5.2.10 running on Windows XP.

This issue appears to be caused by a problem with the 'returnGlobal' function in application\helpers\common_helper.php.

returnGlobal uses the 'empty' function to decide whether it needs to retrieve the value from say $_POST and use it to populate $urlParam.

Unfortunately, the field that caused me headaches with this (emailsmtpdebug) uses the value '0' for Off. Clearly from the documents at php.net, the empty function considers '0' to be empty and thus returns TRUE meaning that (!empty($_POST[$stringname])) evaluates to false and the value is not returned. As a consequence, a NULL value is passed into setGlobalSetting which results in the SQL failing because stg_value gets a NULL (hence the constraint violation error).

I've only literally just downloaded LimeSurvey and I've not got enough time at the moment to investigate and put forward a fix, but a change from using empty is probably required. As I say, if I had more time I would investigate the knock on effects of making such a change and possibly submit a patch. It really needs a dev who knows plenty more about the project as a whole to make an assessment as I suspect 'returnGlobal' is used quite a lot.

TagsNo tags attached.
Bug heat8
Complete LimeSurvey version number (& build)120920
I will donate to the project if issue is resolvedNo
Browser
Database type & versionMySQL 5.1
Server OS (if known)Windows XP SP3
Webserver software & version (if known)Apache 2.2
PHP Version5.2.10

Relationships

has duplicate 06583 closedc_schmitz Internal Server Error when trying to save global settings 
related to 06600 closedc_schmitz Fixing issue#06578 causing new problem in saving global settings 

Users monitoring this issue

There are no users monitoring this issue.

Activities

c_schmitz

c_schmitz

2012-09-24 11:03

administrator   ~20771

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

c_schmitz

c_schmitz

2012-09-24 14:07

administrator   ~20776

2.00+ 120924 released. Please update manually as ComfortUpdate is not working yet.

c_schmitz

c_schmitz

2012-09-28 15:44

administrator   ~20880

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

Related Changesets

LimeSurvey: master 23b925be

2012-09-24 04:03

c_schmitz


Details Diff
Fixed issue 06578: Error whan saving global settings Affected Issues
06578
mod - application/controllers/admin/globalsettings.php Diff File
mod - application/views/admin/globalSettings_view.php Diff File

LimeSurvey: master 8403e06a

2012-09-28 08:44

c_schmitz


Details Diff
Fixed issue 06578: Error whan saving global settings Affected Issues
06578
mod - application/controllers/admin/globalsettings.php Diff File
mod - application/helpers/common_helper.php Diff File

Issue History

Date Modified Username Field Change
2012-09-21 18:17 user21877 New Issue
2012-09-21 18:18 user21877 Issue Monitored: user21877
2012-09-24 11:03 c_schmitz Assigned To => c_schmitz
2012-09-24 11:03 c_schmitz Status new => assigned
2012-09-24 11:03 c_schmitz Changeset attached => LimeSurvey master 23b925be
2012-09-24 11:03 c_schmitz Note Added: 20771
2012-09-24 11:03 c_schmitz Resolution open => fixed
2012-09-24 11:03 c_schmitz Status assigned => resolved
2012-09-24 11:03 c_schmitz Fixed in Version => 2.00+
2012-09-24 11:04 c_schmitz Relationship added has duplicate 06583
2012-09-24 14:07 c_schmitz Note Added: 20776
2012-09-24 14:07 c_schmitz Status resolved => closed
2012-09-28 15:42 c_schmitz Relationship added related to 06600
2012-09-28 15:44 c_schmitz Changeset attached => LimeSurvey master 8403e06a
2012-09-28 15:44 c_schmitz Note Added: 20880