Skip to content

Commit

Permalink
Fixed issue #6043: Errors creating surveys in MSSQL
Browse files Browse the repository at this point in the history
  • Loading branch information
c-schmitz committed Apr 24, 2012
1 parent e6d846d commit abd5075
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions classes/expressions/LimeExpressionManager.php
Expand Up @@ -6444,10 +6444,20 @@ private function getQuestionAttributesForEM($surveyid=NULL,$qid=NULL, $lang=NULL
if (!is_null($lang)) {
$lang = " and a.language='".$lang."' and b.language='".$lang."'";
}
global $databasetype;
if ($databasetype == 'odbc_mssql' || $databasetype == 'odbtp' || $databasetype == 'mssql_n' || $databasetype =='mssqlnative')
{
$query = "select distinct a.qid, a.attribute, CAST(a.value as varchar)";
}
else
{
$query = "select distinct a.qid, a.attribute, a.value";
}

// TODO - does this need to be filtered by language?
$query = "select distinct a.qid, a.attribute, a.value"
." from ".db_table_name('question_attributes')." as a, ".db_table_name('questions')." as b"
$query = "select distinct a.qid, a.attribute, a.value";

$query .= " from ".db_table_name('question_attributes')." as a, ".db_table_name('questions')." as b"
." where " . $where
.$lang
." order by a.qid, a.attribute";
Expand Down

0 comments on commit abd5075

Please sign in to comment.