mod/data MDL-23284 fix database error that was chewing up HTML output.

Author: Jonathan Harker <[email protected]>
This commit is contained in:
Jonathan Harker
2010-07-19 05:19:47 +00:00
parent 6fa788ab37
commit c603457381
+3 -3
View File
@@ -29,14 +29,14 @@
<option value="-2"<?php if($this->field->param2==-2) echo ' selected="selected"' ?>><?php echo get_string('latitude', 'data').'/'.get_string('longitude', 'data') ?></option>
<?php
// Fetch all "suitable" other fields that exist for this database
$textfields = $DB->get_records_select('data_fields', array('dataid'=>$this->data->id, 'type'=>'text'));
echo '<optgroup label="'.get_string('latlongotherfields', 'data').':">';
$textfields = $DB->get_records_select('data_fields', 'dataid = :dataid and type = :type', array('dataid'=>$this->data->id, 'type'=>'text'));
if(sizeof($textfields)>0) {
echo '<optgroup label="'.get_string('latlongotherfields', 'data').':">';
foreach($textfields as $textfield) {
echo "<option value='$textfield->id'".($this->field->param2==$textfield->id ? ' selected="selected"' : '').">$textfield->name</option>";
}
}
echo '</optgroup>';
}
?>
</select>
</td>