Merge branch 'MDL-36051_23' of git://github.com/rlorenzo/moodle into MOODLE_23_STABLE
authorDan Poltawski <dan@moodle.com>
Thu, 8 Nov 2012 07:10:06 +0000 (15:10 +0800)
committerDan Poltawski <dan@moodle.com>
Thu, 8 Nov 2012 07:10:06 +0000 (15:10 +0800)
mod/assign/locallib.php
mod/assign/module.js

index 7238b70..1e24886 100644 (file)
@@ -2760,7 +2760,9 @@ class assign {
                                                                  'showquickgrading'=>false));
         if ($formdata = $mform->get_data()) {
             set_user_preference('assign_perpage', $formdata->perpage);
-            set_user_preference('assign_filter', $formdata->filter);
+            if (isset($formdata->filter)) {
+                set_user_preference('assign_filter', $formdata->filter);
+            }
         }
     }
 
index a1cbe07..ec5e071 100644 (file)
@@ -117,9 +117,11 @@ M.mod_assign.init_grading_options = function(Y) {
             Y.one('form.gradingoptionsform').submit();
         });
         var filterelement = Y.one('#id_filter');
-        filterelement.on('change', function(e) {
-            Y.one('form.gradingoptionsform').submit();
-        });
+        if (filterelement) {
+            filterelement.on('change', function(e) {
+                Y.one('form.gradingoptionsform').submit();
+            });
+        }
         var quickgradingelement = Y.one('#id_quickgrading');
         if (quickgradingelement) {
             quickgradingelement.on('change', function(e) {
@@ -139,4 +141,4 @@ M.mod_assign.init_grade_change = function(Y) {
             }
         });
     }
-};
\ No newline at end of file
+};