mod/data MDL-23284 fix database error that was chewing up HTML output.
Author: Jonathan Harker <[email protected]>
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user