LimeSurvey issue tracker
Registration

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
05900Bug reports[All Projects] Import/Exportpublic2012-03-12 11:492012-03-15 01:19
Reporterulysse68 
Assigned Toc_schmitz 
PrioritynormalSeveritymajor 
StatusclosedResolutionfixed 
Product Version2.00a2 
Target VersionFixed in Version2.00a3 
Summary05900: Unable to import a survey
DescriptionUnable to import a survey (.lss) exported from LimeSurvey 1.92. I tried several examples, but there is always the same message: Undefined variable sFullFilepath (see additional information).
Additional InformationHere is the full error message:

PHP Error

Undefined variable: sFullFilepath

/var/www/limesurvey2/application/controllers/admin/surveyadmin.php(929)

917 }
918 }
919 elseif ($action == 'copysurvey' && (empty($importerror) || !$importerror))
920 {
921 $aImportResults = XMLImportSurvey('', $copysurveydata, $sNewSurveyName);
922 }
923 else
924 {
925 $importerror = true;
926 }
927 if ($action == 'importsurvey')
928 {
929 unlink($sFullFilepath);
930 }
931
932 if (isset($aImportResults['error']) && $aImportResults['error']) safeDie($aImportResults['error']);
933
934 $aData['action'] = $action;
935 $aData['sLink'] = $this->getController()->createUrl('admin/survey/view/surveyid/' . $aImportResults['newsid']);
936 $aData['aImportResults'] = $aImportResults;
937 }
938
939 $this->_renderWrappedTemplate('survey', 'importSurvey_view', $aData);
940 }
941

Stack Trace
#0
 unknown(0): SurveyAdmin->copy()
#1
+
 /var/www/limesurvey2/framework/web/actions/CAction.php(104): ReflectionMethod->invokeArgs(SurveyAdmin, array())
#2

 /var/www/limesurvey2/application/core/Survey_Common_Action.php(82): CAction->runWithParamsInternal(SurveyAdmin, ReflectionMethod, array("sa" => "copy"))

77 $oMethod = new ReflectionMethod($this, $sDefault);
78 }
79
80 // We're all good to go, let's execute it
81 // runWithParamsInternal would automatically get the parameters of the method and populate them as required with the params
82 return parent::runWithParamsInternal($this, $oMethod, $params);
83 }
84
85 /**
86 * Some functions have different parameters, which are just an alias of the
87 * usual parameters we're getting in the url. This function just populates

#3
+
 /var/www/limesurvey2/framework/web/CController.php(300): Survey_Common_Action->runWithParams(array("sa" => "copy"))
#4
+
 /var/www/limesurvey2/framework/web/CController.php(278): CController->runAction(SurveyAdmin)
#5
+
 /var/www/limesurvey2/framework/web/CController.php(257): CController->runActionWithFilters(SurveyAdmin, array())
#6

 /var/www/limesurvey2/application/controllers/AdminController.php(149): CController->run("survey")

144 Yii::app()->session['redirectopage'] = Yii::app()->request->requestUri;
145
146 $this->redirect($this->createUrl('/admin/authentication/login'));
147 }
148
149 return parent::run($action);
150 }
151
152 /**
153 * Routes all the actions to their respective places
154 *

#7
+
 /var/www/limesurvey2/framework/web/CWebApplication.php(277): AdminController->run("survey")
#8
+
 /var/www/limesurvey2/framework/web/CWebApplication.php(136): CWebApplication->runController("admin/survey/sa/copy")
#9
+
 /var/www/limesurvey2/framework/base/CApplication.php(158): CWebApplication->processRequest()
#10

 /var/www/limesurvey2/index.php(171): CApplication->run()

166 *
167 */
168 require_once BASEPATH . 'yii' . EXT;
169 require_once APPPATH . 'core/LSYii_Application' . EXT;
170
171 Yii::createApplication('LSYii_Application', APPPATH . 'config/config' . EXT)->run();
172
173 /* End of file index.php */
174 /* Location: ./index.php */

2012-03-12 09:51:11 Apache/2.2.20 (Ubuntu) Yii Framework/1.1.8
I will donate to the project if issue is resolved within 48 hrsNo
LimeSurvey build number OR git commit ID000000
Browser
Database & DB-VersionMySQL 5
Operating System (Server)GNU/Linux
Webserver software & versionApache 2
PHP Version5.3
Attached Files? file icon limesurvey_survey_29975.lss [^] (55,980 bytes) 2012-03-12 20:02
? file icon import_helper.php [^] (171,822 bytes) 2012-03-12 20:23

- Relationships

-  Notes
User avatar (17887)
c_schmitz (administrator)
2012-03-12 16:25

I can't reproduce that here. I guess your file_upload_dir is not writable somehow.
User avatar (17888)
ulysse68 (reporter)
2012-03-12 16:47

I double checked:

greg@dionysos:~$ ls -l /var/www/limesurvey2/
total 72
drwxr-xr-x 2 greg greg 4096 2012-03-11 16:18 admin
drwxr-xr-x 17 greg greg 4096 2012-03-11 16:18 application
drwxr-xr-x 3 greg greg 4096 2012-03-11 16:18 docs
drwxr-xr-x 2 greg greg 4096 2012-03-11 16:18 fonts
drwxr-xr-x 19 greg greg 4096 2012-03-11 16:18 framework
drwxr-xr-x 5 greg greg 12288 2012-03-11 16:18 images
-rw-r--r-- 1 greg greg 5688 2012-03-11 16:18 index.php
drwxr-xr-x 5 greg greg 4096 2012-03-11 16:18 installer
drwxr-xr-x 63 greg greg 4096 2012-03-11 16:18 locale
-rw-r--r-- 1 greg greg 61 2012-03-11 16:18 README
drwxr-xr-x 4 greg greg 4096 2012-03-11 16:18 scripts
drwxr-xr-x 3 greg greg 4096 2012-03-11 16:18 styles
drwxrwxrwx 12 greg greg 4096 2012-03-11 16:18 templates
drwxr-xr-x 3 greg greg 4096 2012-03-11 16:18 tmp
drwxrwxrwx 6 greg greg 4096 2012-03-11 16:18 upload

Subdirectories are also writeable. And I precise that my user (greg) has the same rights as www-data. I am trying on another computer and let you know.
User avatar (17889)
c_schmitz (administrator)
2012-03-12 17:10

What about /tmp?
User avatar (17891)
ulysse68 (reporter)
2012-03-12 17:23

Done:

greg@dionysos:/var/www$ ll /var/www/limesurvey2/tmptotal 16
drwxrwxrwx 3 www-data www-data 4096 2012-03-12 17:22 ./
drwxr-xr-x 15 www-data www-data 4096 2012-03-11 16:18 ../
-rw-rw-rw- 1 www-data www-data 0 2012-03-11 16:18 index.html
-rw-rw-rw- 1 www-data www-data 110 2012-03-11 16:18 readme.txt
drwxrwxrwx 2 www-data www-data 4096 2012-03-11 16:18 uploads/

And... The error changed!

CException

Property "Survey.showXquestions" is not defined.

/var/www/limesurvey2/framework/db/ar/CActiveRecord.php(145)

133 * PHP setter magic method.
134 * This method is overridden so that AR attributes can be accessed like properties.
135 * @param string $name property name
136 * @param mixed $value property value
137 */
138 public function __set($name,$value)
139 {
140 if($this->setAttribute($name,$value)===false)
141 {
142 if(isset($this->getMetaData()->relations[$name]))
143 $this->_related[$name]=$value;
144 else
145 parent::__set($name,$value);
146 }
147 }
148
149 /**
150 * Checks if a property value is null.
151 * This method overrides the parent implementation by checking
152 * if the named attribute is null or not.
153 * @param string $name the property name or the event name
154 * @return boolean whether the property value is null
155 * @since 1.0.1
156 */
157 public function __isset($name)

Stack Trace
#0
+
 /var/www/limesurvey2/framework/db/ar/CActiveRecord.php(145): CComponent->__set("showXquestions", "Y")
#1

 /var/www/limesurvey2/application/models/Survey.php(202): CActiveRecord->__set("showXquestions", "Y")

197 $data["faxto"] = $filter->purify($data["faxto"]);
198 }
199
200 $survey = new self;
201 foreach ($data as $k => $v)
202 $survey->$k = $v;
203 $survey->save();
204 return $data['sid'];
205 }
206
207 /**

#2

 /var/www/limesurvey2/application/helpers/admin/import_helper.php(3430): Survey->insertNewSurvey(array("sid" => "635999", "admin" => "", "expires" => null, "startdate" => null, ...))

3425 }
3426
3427 switchMSSQLIdentityInsert('surveys',true);
3428 if ($xssfilter)
3429 XSSFilterArray($insertdata);
3430 $newsid = Survey::model()->insertNewSurvey($insertdata) or safeDie($clang->gT("Error").": Failed to insert data
");
3431
3432 $results['surveys']++;
3433 switchMSSQLIdentityInsert('surveys',false);
3434 }
3435

#3

 /var/www/limesurvey2/application/controllers/admin/surveyadmin.php(849): XMLImportSurvey("/var/www/limesurvey2/tmp/limesurvey_survey_635999.lss", null, null, null, ...)

844 {
845 $aImportResults = CSVImportSurvey($sFullFilepath, null, (isset($_POST['translinksfields'])));
846 }
847 elseif (isset($sExtension) && strtolower($sExtension) == 'lss')
848 {
849 $aImportResults = XMLImportSurvey($sFullFilepath, null, null, null, (isset($_POST['translinksfields'])));
850 }
851 elseif (isset($sExtension) && strtolower($sExtension) == 'zip') // Import a survey archive
852 {
853 Yii::import("application.libraries.admin.pclzip.pclzip", true);
854 $pclzip = new PclZip(array('p_zipname' => $sFullFilepath));

#4
 unknown(0): SurveyAdmin->copy()
#5
+
 /var/www/limesurvey2/framework/web/actions/CAction.php(104): ReflectionMethod->invokeArgs(SurveyAdmin, array())
#6
+
 /var/www/limesurvey2/application/core/Survey_Common_Action.php(82): CAction->runWithParamsInternal(SurveyAdmin, ReflectionMethod, array("sa" => "copy"))
#7
+
 /var/www/limesurvey2/framework/web/CController.php(300): Survey_Common_Action->runWithParams(array("sa" => "copy"))
#8
+
 /var/www/limesurvey2/framework/web/CController.php(278): CController->runAction(SurveyAdmin)
#9
+
 /var/www/limesurvey2/framework/web/CController.php(257): CController->runActionWithFilters(SurveyAdmin, array())
#10
+
 /var/www/limesurvey2/application/controllers/AdminController.php(149): CController->run("survey")
#11
+
 /var/www/limesurvey2/framework/web/CWebApplication.php(277): AdminController->run("survey")
#12
+
 /var/www/limesurvey2/framework/web/CWebApplication.php(136): CWebApplication->runController("admin/survey/sa/copy")
#13
+
 /var/www/limesurvey2/framework/base/CApplication.php(158): CWebApplication->processRequest()
#14
+
 /var/www/limesurvey2/index.php(171): CApplication->run()
2012-03-12 17:19:35 Apache/2.2.20 (Ubuntu) Yii Framework/1.1.8
User avatar (17893)
c_schmitz (administrator)
2012-03-12 17:29

Please attach the survey. Thank you!
User avatar (17898)
ulysse68 (reporter)
2012-03-12 20:04

I used the "Slightly Trickier Sample Survey" (see attached). Maybe the problem comes from my system (local server on Ubuntu 11.10). Still trying on a remote server, but I've been busy and my connection is slow :-(
User avatar (17899)
c_schmitz (administrator)
2012-03-12 20:23

I found the issue. It will be fixed in the next rev. Attached a fixed file.
User avatar (17901)
ulysse68 (reporter)
2012-03-12 20:49

I still have an error (CException) with the new file (application/helpers/admin/import_helper.php) -- but it changed again!

"Property "Survey.googleAnalyticsStyle" is not defined."

But all right, I'll check with the next rev.

- Issue History
Date Modified Username Field Change
2012-03-12 11:49 ulysse68 New Issue
2012-03-12 16:16 c_schmitz Assigned To => c_schmitz
2012-03-12 16:16 c_schmitz Status new => assigned
2012-03-12 16:25 c_schmitz Note Added: 17887
2012-03-12 16:47 ulysse68 Note Added: 17888
2012-03-12 17:10 c_schmitz Note Added: 17889
2012-03-12 17:10 c_schmitz Status assigned => feedback
2012-03-12 17:23 ulysse68 Note Added: 17891
2012-03-12 17:23 ulysse68 Status feedback => assigned
2012-03-12 17:29 c_schmitz Note Added: 17893
2012-03-12 20:02 ulysse68 File Added: limesurvey_survey_29975.lss
2012-03-12 20:04 ulysse68 Note Added: 17898
2012-03-12 20:23 c_schmitz Note Added: 17899
2012-03-12 20:23 c_schmitz File Added: import_helper.php
2012-03-12 20:49 ulysse68 Note Added: 17901
2012-03-15 01:19 c_schmitz Status assigned => closed
2012-03-15 01:19 c_schmitz Resolution open => fixed
2012-03-15 01:19 c_schmitz Fixed in Version => 2.00a3


Copyright © 2000 - 2014 MantisBT Team
Powered by Mantis Bugtracker