]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1036242: "TypeError: bug_status is undefined" when creating a bug
authorMatt Tyson <mtyson@redhat.com>
Wed, 10 Sep 2014 14:56:06 +0000 (22:56 +0800)
committerByron Jones <glob@mozilla.com>
Wed, 10 Sep 2014 14:56:06 +0000 (22:56 +0800)
r=glob,a=glob

js/field.js

index 20b08da48ff18a05844ba9d534d73b11cee5e4cc..1cd58a69ac9963d56f4d0ee9e566ad29b45e65ea 100644 (file)
@@ -46,10 +46,14 @@ function validateEnterBug(theform) {
         _errorFor(attach_desc, 'attach_desc');
         focus_me = attach_desc;
     }
-    var check_description = status_comment_required[bug_status.value];
-    if (check_description && YAHOO.lang.trim(description.value) == '') {
-        _errorFor(description, 'description');
-        focus_me = description;
+    // bug_status can be undefined if the bug_status field is not editable by
+    // the currently logged in user.
+    if (bug_status) {
+        var check_description = status_comment_required[bug_status.value];
+        if (check_description && YAHOO.lang.trim(description.value) == '') {
+            _errorFor(description, 'description');
+            focus_me = description;
+        }
     }
     if (YAHOO.lang.trim(short_desc.value) == '') {
         _errorFor(short_desc);