Skip to content

Commit

Permalink
Fixed issue #6478: Unable to import excel survey
Browse files Browse the repository at this point in the history
Dev Fixed incorrect URL description reading in Excel reader
  • Loading branch information
c-schmitz committed Aug 17, 2012
1 parent f003d3d commit 3e96fa1
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
6 changes: 1 addition & 5 deletions application/helpers/admin/import_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -4275,15 +4275,11 @@ function ExcelImportSurvey($sFullFilepath)
}

// Create the survey entry
$iNewSID=GetNewSurveyID($iOldSID);
$surveyinfo['startdate']=NULL;
$surveyinfo['sid']=$iNewSID;
$surveyinfo['active']='N';
$surveyinfo['owner_id']=$_SESSION['loginID'];
$surveyinfo['datecreated']=new CDbExpression('NOW()');

switchMSSQLIdentityInsert('surveys',true);
$iNewSID = Survey::model()->insertNewSurvey($surveyinfo) or safeDie($clang->gT("Error").": Failed to insert survey<br />");
$surveyinfo['sid']=$iNewSID;
$results['surveys']++;
switchMSSQLIdentityInsert('surveys',false);
$results['newsid']=$iNewSID;
Expand Down
2 changes: 1 addition & 1 deletion application/libraries/admin/excel/excel_reader2.php
Original file line number Diff line number Diff line change
Expand Up @@ -858,7 +858,7 @@ function dump($row_numbers=false,$col_letters=false,$sheet=0,$table_class='excel
function read16bitstring($data, $start) {
$len = 0;
while (ord($data[$start + $len]) + ord($data[$start + $len + 1]) > 0) $len++;
return substr($data, $start, $len);
return substr($data, $start, $len+1);
}

// ADDED by Matt Kruse for better formatting
Expand Down
1 change: 1 addition & 0 deletions tmp/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
*.html
/*.lss
/*.png
/*.xls

0 comments on commit 3e96fa1

Please sign in to comment.