Permalink
Browse files

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

Author: Jonathan Harker <jonathan@catalyst.net.nz>
  • Loading branch information...
1 parent 6fa788a commit c603457381b8d641e2539855221b744e2dfa76e8 @doctorlard doctorlard committed Jul 19, 2010
Showing with 3 additions and 3 deletions.
  1. +3 −3 mod/data/field/latlong/mod.html
@@ -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>

0 comments on commit c603457

Please sign in to comment.