]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Adding tests so we can make sure it passes :)
authorjustdave%syndicomm.com <>
Sat, 17 Nov 2001 15:41:52 +0000 (15:41 +0000)
committerjustdave%syndicomm.com <>
Sat, 17 Nov 2001 15:41:52 +0000 (15:41 +0000)
Bug.pm
t/001compile.t

diff --git a/Bug.pm b/Bug.pm
index ea159ccdc9919f08fcf38b8ad1b9e61dc937c14c..6c230ad5d3feafcc21ac8daf88988c1f191aee36 100755 (executable)
--- a/Bug.pm
+++ b/Bug.pm
@@ -27,13 +27,15 @@ use strict;
 
 use DBI;
 use RelationSet;
-use vars qw($unconfirmedstate $legal_keywords);
 require "globals.pl";
 require "CGI.pl";
 package Bug;
 use CGI::Carp qw(fatalsToBrowser);
 my %ok_field;
 
+@::legal_keywords = @::legal_keywords; # kill "used only once" warning
+$::unconfirmedstate = $::unconfirmedstate;
+
 for my $key (qw (bug_id product version rep_platform op_sys bug_status 
                 resolution priority bug_severity component assigned_to
                 reporter bug_file_loc short_desc target_milestone 
@@ -87,7 +89,7 @@ sub initBug  {
   }
   else {
      if ($user_id =~ /^\@/) {
-        $user_id = &::DBname_to_id($user_id); 
+       $user_id = &::DBname_to_id($user_id); 
      }
   }
      
@@ -114,9 +116,10 @@ sub initBug  {
       groupset, delta_ts, sum(votes.count)
     from bugs left join votes using(bug_id)
     where bugs.bug_id = $bug_id
+    and bugs.groupset & $usergroupset = bugs.groupset
     group by bugs.bug_id";
 
-  &::SendSQL(&::SelectVisible($query, $user_id, $usergroupset));
+  &::SendSQL($query);
   my @row;
 
   if (@row = &::FetchSQLData()) {
@@ -128,11 +131,11 @@ sub initBug  {
                        "bug_file_loc", "short_desc", "target_milestone",
                        "qa_contact", "status_whiteboard", "creation_ts",
                        "groupset", "delta_ts", "votes") {
-        $fields{$field} = shift @row;
-        if ($fields{$field}) {
-            $self->{$field} = $fields{$field};
-        }
-        $count++;
+       $fields{$field} = shift @row;
+       if ($fields{$field}) {
+           $self->{$field} = $fields{$field};
+       }
+       $count++;
     }
   } else {
     &::SendSQL("select groupset from bugs where bug_id = $bug_id");
@@ -445,7 +448,6 @@ sub Collision {
     my $write = "WRITE";        # Might want to make a param to control
                                 # whether we do LOW_PRIORITY ...
     &::SendSQL("LOCK TABLES bugs $write, bugs_activity $write, cc $write, " .
-               "cc AS selectVisible_cc $write, " .
             "profiles $write, dependencies $write, votes $write, " .
             "keywords $write, longdescs $write, fielddefs $write, " .
             "keyworddefs READ, groups READ, attachments READ, products READ");
index 4fc5686625db72730b77d71e27f4b21f4b128d14..63f59af9a79db7de5a925622b455b27782cc2842 100644 (file)
@@ -38,7 +38,7 @@
 ###Compilation###
 BEGIN { use lib 't/'; }
 BEGIN { use Support::Files; }
-BEGIN { $tests = @Support::Files::testitems + 4; }
+BEGIN { $tests = @Support::Files::testitems + 3; }
 BEGIN { use Test::More tests => $tests; }
 
 use strict;
@@ -78,9 +78,8 @@ foreach my $file (@testitems) {
 
 # and the libs:                                                                 
 use_ok('Token'); # 52                                                 
-use_ok('Attachment'); # 53                                            
-use_ok('Bug'); # 54                                            
-use_ok('RelationSet'); # 55                                           
+use_ok('Bug'); # 53                                            
+use_ok('RelationSet'); # 54