MDL-57807 mod_data: Advanced search with menu item.
authorAdrian Greeve <adrian@moodle.com>
Wed, 26 Apr 2017 05:36:53 +0000 (13:36 +0800)
committerAdrian Greeve <adrian@moodle.com>
Thu, 27 Apr 2017 00:58:13 +0000 (08:58 +0800)
It is now possible to search other criteria without first
setting the menu items.

Thanks to Sergey Gorbatov for providing this patch.

mod/data/field/menu/field.class.php

index e4ac3e0..1463648 100644 (file)
@@ -104,7 +104,8 @@ class data_field_menu extends data_field_base {
 
         $return = html_writer::label(get_string('fieldtypelabel', "datafield_" . $this->type),
             'menuf_' . $this->field->id, false, array('class' => 'accesshide'));
-        $return .= html_writer::select($options, 'f_'.$this->field->id, $content, array('class' => 'custom-select'));
+        $return .= html_writer::select($options, 'f_'.$this->field->id, $content, array('' => get_string('menuchoose', 'data')),
+                array('class' => 'custom-select'));
         return $return;
     }