Fix for Bug #4969. Renamed variable $mode to $template.

This commit is contained in:
vyshane 2006-03-24 02:09:15 +00:00
parent 311c697a86
commit f41cadeba7

View File

@ -318,12 +318,12 @@ function data_generate_default_template($data, $template, $recordid=0, $form=fal
}
//get all the fields for that database
if ($fields = get_records('data_fields', 'dataid', $data->id)){
if ($fields = get_records('data_fields', 'dataid', $data->id)) {
$str = '<div align="center">';
$str .= '<table>';
foreach ($fields as $field){
foreach ($fields as $field) {
$str .= '<tr><td valign="top" align="right">';
$str .= $field->name.':';
@ -353,7 +353,7 @@ function data_generate_default_template($data, $template, $recordid=0, $form=fal
if ($update) {
$newdata->id = $data->id;
$newdata->{$mode} = $str;
$newdata->{$template} = $str;
if (!update_record('data', $newdata)) {
notify('Error updating template');
}