Fix for bug: when students try to add an entry while no field is defined, the

foreach barfs on the value of $fields, which is false.
This commit is contained in:
vyshane
2006-05-25 05:14:53 +00:00
parent 670cced63a
commit 46941b6043
+4 -2
View File
@@ -320,9 +320,11 @@
/// Finish the page
// Print the stuff that need to come after the form fields.
$fields = get_records('data_fields', 'dataid', $data->id);
if (!$fields = get_records('data_fields', 'dataid', $data->id)) {
error(get_string('nofieldindatabase'));
}
foreach ($fields as $eachfield) {
$field = data_get_field($eachfield, $data);
$field->print_after_form();