View Issue Details

This issue affects 1 person(s).
 2
IDProjectCategoryView StatusLast Update
09420Bug reportsOtherpublic2014-12-29 16:10
Reportergkuchyt Assigned Toc_schmitz  
PrioritylowSeverityblock 
Status closedResolutionwon't fix 
Product Version2.05+ 
Summary09420: Possible database condition can cause app crash
Description

I have a survey that has an entry in the lime_surveys table but doesn't have a corresponding limesurvey##### (where ##### is the sid) table. As well lime_surveys_languagesettings has no entry for this survey. When loading the admin interface after upgrading the schema I get the attached error.

It looks like $result->defaultlanguage->attributes is not defined in this case. The entry for this survey in lime_surveys table has NULL as the language.

Clearly a problem with our data, but I thought it might be worth while to put a patch in place to make it not cause a crash (see below). I wish I could answer the question as to how we got data like this in our database.

Steps To Reproduce

Have a survey stub as above in lime_surveys but no other database data.

Additional Information

Proposed patch to not cause this to crash the admin interface.

application/helpers/common_helper.php | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/application/helpers/common_helper.php b/application/helpers/common_helper.php
index 545772a..f35e4c2 100644
--- a/application/helpers/common_helper.php
+++ b/application/helpers/common_helper.php
@@ -145,6 +145,9 @@ function getSurveyList($returnarray=false, $surveyid=false)
$surveynames = array();
foreach ($surveyidresult as $result)
{

  • if(!(isset($result->defaultlanguage->attributes))) {
  • continue;
  • }
    $surveynames[] = array_merge($result->attributes, $result->defaultlanguage->attributes);
    }
TagsNo tags attached.
Attached Files
Bug heat2
Complete LimeSurvey version number (& build)57d56b7bdff55f7a86e76c28778a
I will donate to the project if issue is resolvedNo
Browser
Database type & versionMySQL 5.5.35
Server OS (if known)RHEL 6
Webserver software & version (if known)Apache 2.2.15
PHP Version5.3.3
Git branch / Pull Request URL

Users monitoring this issue

There are no users monitoring this issue.

Activities

c_schmitz

c_schmitz

2014-12-29 16:10

administrator   ~31382

The patch does not really fix the underlying issue and encourages deformed data.
The LimeSurvey integrity check does catch and correct the issue though, so you can use that to correct the problem. Anyway, foremost it is a problem of your data writer, as you already suggested.

Issue History

Date Modified Username Field Change
2014-12-22 21:34 gkuchyt New Issue
2014-12-22 21:34 gkuchyt File Added: Screen Shot 2014-12-22 at 14.33.46 .png
2014-12-29 16:10 c_schmitz Note Added: 31382
2014-12-29 16:10 c_schmitz Status new => closed
2014-12-29 16:10 c_schmitz Assigned To => c_schmitz
2014-12-29 16:10 c_schmitz Resolution open => won't fix