Skip to content

Commit

Permalink
Fixed #6984: Can't save edits to a response with MSSQL Server (Field …
Browse files Browse the repository at this point in the history
…Name's not wrapped)

dev: also updated link to browse response
  • Loading branch information
mennodekker committed Nov 29, 2012
1 parent fef75cb commit 34960a6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions application/controllers/admin/dataentry.php
Expand Up @@ -766,33 +766,33 @@ public function update()
{
if (isset($_POST['completed']) && ($_POST['completed']== "N"))
{
$updateqr .= $q->fieldname." = NULL, \n"; //dbQuoteID($q->fieldname)." = NULL, \n";
$updateqr .= dbQuoteID($q->fieldname) . " = NULL, \n";
}
elseif (isset($_POST['completed']) && $thisvalue=="")
{
$updateqr .= $q->fieldname." = '" . $_POST['completed'] . "', \n";// dbQuoteID($q->fieldname)." = " . dbQuoteAll($_POST['completed'],true) . ", \n";
$updateqr .= dbQuoteID($q->fieldname)." = " . dbQuoteAll($_POST['completed']) . ", \n";
}
else
{
$updateqr .= $q->fieldname." = '" . $thisvalue . "', \n"; //dbQuoteID($q->fieldname)." = " . dbQuoteAll($thisvalue,true) . ", \n";
$updateqr .= dbQuoteID($q->fieldname)." = " . dbQuoteAll($thisvalue) . ", \n";
}
}
elseif(!is_a($q, 'QuestionModule'))
{
$thisvalue = $q->filter($thisvalue, 'dataentry');
$updateqr .= $q->fieldname . ' = ' . $thisvalue == null ? 'NULL' : $thisvalue . ', \n';
$updateqr .= dbQuoteID($q->fieldname) . ' = ' . $thisvalue == null ? 'NULL' : dbQuoteAll($thisvalue) . ', \n';
}
else
{
$updateqr .= $q->fieldname." = '" . $thisvalue . "', \n"; // dbQuoteID($q->fieldname)." = " . dbQuoteAll($thisvalue,true) . ", \n";
$updateqr .= dbQuoteID($q->fieldname)." = " . dbQuoteAll($thisvalue) . ", \n";
}
}
$updateqr = substr($updateqr, 0, -3);
$updateqr .= " WHERE id=$id";

$updateres = dbExecuteAssoc($updateqr) or safeDie("Update failed:<br />\n<br />$updateqr");

$onerecord_link = $this->getController()->createUrl('/').'/admin/responses/index/surveyid/'.$surveyid.'/id/'.$id;
$onerecord_link = $this->getController()->createUrl('/').'/admin/responses/view/surveyid/'.$surveyid.'/id/'.$id;
$allrecords_link = $this->getController()->createUrl('/').'/admin/responses/index/surveyid/'.$surveyid;
$aDataentryoutput .= "<div class='messagebox ui-corner-all'><div class='successheader'>".$clang->gT("Success")."</div>\n"
.$clang->gT("Record has been updated.")."<br /><br />\n"
Expand Down

0 comments on commit 34960a6

Please sign in to comment.