]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 528918: Bugzilla::Object->match() shouldn't call _check_field() when the field...
authorFrédéric Buclin <LpSolit@gmail.com>
Tue, 28 Feb 2012 23:00:12 +0000 (00:00 +0100)
committerFrédéric Buclin <LpSolit@gmail.com>
Tue, 28 Feb 2012 23:00:12 +0000 (00:00 +0100)
r=dkl a=LpSolit

Bugzilla/Object.pm

index 1b0af509dcdc98c51a2fca2f40dee8ff421abb2e..c606540fa7b8c2b14278d71785e7065e36dd45b4 100644 (file)
@@ -214,8 +214,11 @@ sub match {
             }            
             next;
         }
-        
-        $class->_check_field($field, 'match');
+
+        # It's always safe to use the field defined by classes as being
+        # their ID field. In particular, this means that new_from_list()
+        # is exempted from this check.
+        $class->_check_field($field, 'match') unless $field eq $class->ID_FIELD;
 
         if (ref $value eq 'ARRAY') {
             # IN () is invalid SQL, and if we have an empty list