Skip to content

Commit

Permalink
Fixed issue #8083: Token attributes being mapped to the CPDB cannot b…
Browse files Browse the repository at this point in the history
…e properly used
  • Loading branch information
c-schmitz committed Jan 22, 2014
1 parent f188b85 commit 85ca290
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 15 deletions.
15 changes: 2 additions & 13 deletions application/controllers/admin/tokens.php
Expand Up @@ -1909,17 +1909,9 @@ function import($iSurveyId)
foreach ($tokenlistarray as $buffer)
{
$buffer = @mb_convert_encoding($buffer, "UTF-8", $uploadcharset);
$firstname = "";
$lastname = "";
$email = "";
$emailstatus = "OK";
$token = "";
$language = "";
$attribute1 = "";
$attribute2 = ""; //Clear out values from the last path, in case the next line is missing a value
if ($recordcount == 0)
{
// Pick apart the first line
// Parse first line (header) from CSV
$buffer = removeBOM($buffer);
$allowedfieldnames = array('firstname', 'lastname', 'email', 'emailstatus', 'token', 'language', 'validfrom', 'validuntil', 'usesleft');
$allowedfieldnames = array_merge($attrfieldnames, $allowedfieldnames);
Expand All @@ -1942,7 +1934,7 @@ function import($iSurveyId)
$firstline = convertCSVRowToArray($buffer, $separator, '"');
$firstline = array_map('trim', $firstline);
$ignoredcolumns = array();
//now check the first line for invalid fields
// Now check the first line for invalid fields
foreach ($firstline as $index => $fieldname)
{
$firstline[$index] = preg_replace("/(.*) <[^,]*>$/", "$1", $fieldname);
Expand Down Expand Up @@ -1996,10 +1988,7 @@ function import($iSurveyId)
$duplicatelist[] = Yii::app()->db->quoteValue($writearray['firstname']) . " " . Yii::app()->db->quoteValue($writearray['lastname']) . " (" . Yii::app()->db->quoteValue($writearray['email']) . ")";
}
}


$writearray['email'] = trim($writearray['email']);

//treat blank emails
if ($filterblankemail && $writearray['email'] == '')
{
Expand Down
3 changes: 1 addition & 2 deletions application/models/Survey.php
Expand Up @@ -299,8 +299,7 @@ public function getTokenAttributes()
$ls->save();
$attdescriptiondata = $fields;
}


$aCompleteData=array();
foreach ($attdescriptiondata as $sKey=>$aValues)
{
if (!is_array($aValues)) $aValues=array();
Expand Down

0 comments on commit 85ca290

Please sign in to comment.