From 9c2aadfc0bb73c3de3e5ab90dcdc1a588f82b02b Mon Sep 17 00:00:00 2001 From: Carsten Schmitz Date: Wed, 16 Apr 2014 14:57:56 +0200 Subject: [PATCH] Fixed issue #8967: Unable to map paticipant attributes to "Token attributes to create" when adding participants to survey --- application/models/Participant.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/application/models/Participant.php b/application/models/Participant.php index eb5c8ea170c..23cbe65ccd1 100644 --- a/application/models/Participant.php +++ b/application/models/Participant.php @@ -960,7 +960,7 @@ function copyCPBDAttributesToTokens($surveyid, $mapped, $newcreate, $participant foreach ($newcreate as $key => $value) { $newfieldname='attribute_'.$value; - $fields[$newfieldname] = array('type' => 'STRING'); + $fields[$newfieldname] = array('type' => 'string'); $attname = Yii::app()->db ->createCommand() ->select('{{participant_attribute_names_lang}}.attribute_name, {{participant_attribute_names_lang}}.lang') @@ -1011,6 +1011,8 @@ function copyCPBDAttributesToTokens($surveyid, $mapped, $newcreate, $participant { addColumn("{{tokens_$surveyid}}", $key, $value['type']); } + Yii::app()->db->schema->getTable("{{tokens_$surveyid}}", true); // Refresh schema cache just + } //Write each participant to the survey token table