]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 299211: whine.pl fails if derive_groups is required - Patch by Marc Schumann...
authorlpsolit%gmail.com <>
Fri, 8 Jul 2005 01:33:45 +0000 (01:33 +0000)
committerlpsolit%gmail.com <>
Fri, 8 Jul 2005 01:33:45 +0000 (01:33 +0000)
Bugzilla/Constants.pm
Bugzilla/Flag.pm
whine.pl

index b745ad65f082ca2ffd52735d419c18d039e7d2dd..a626294206bdcd98ea82ed5fcdfe8bbd9c3144ff 100644 (file)
@@ -68,6 +68,8 @@ use base qw(Exporter);
 
     COMMENT_COLS
 
+    DERIVE_GROUPS_TABLES_ALREADY_LOCKED
+
     UNLOCK_ABORT
     
     RELATIONSHIPS
@@ -174,6 +176,10 @@ use constant DEFAULT_QUERY_NAME => '(Default query)';
 # The column length for displayed (and wrapped) bug comments.
 use constant COMMENT_COLS => 80;
 
+# Used to indicate to User::new and User::new_from_login calls
+# that the derive_groups tables are already locked
+use constant DERIVE_GROUPS_TABLES_ALREADY_LOCKED => 1;
+
 # used by Bugzilla::DB to indicate that tables are being unlocked
 # because of error
 use constant UNLOCK_ABORT => 1;
index 464ddffafc2304d9d3fd25ebfb460991c52e265e..f19369c24a32dba8e335c58f16d9ccba51a4320a 100644 (file)
@@ -74,8 +74,6 @@ use Bugzilla::Attachment;
 use Bugzilla::BugMail;
 use Bugzilla::Constants;
 
-use constant TABLES_ALREADY_LOCKED => 1;
-
 # Note that this line doesn't actually import these variables for some reason,
 # so I have to use them as $::template and $::vars in the package code.
 use vars qw($template $vars); 
@@ -865,7 +863,7 @@ sub notify {
         my @new_cc_list;
         foreach my $cc (split(/[, ]+/, $flag->{'type'}->{'cc_list'})) {
             my $ccuser = Bugzilla::User->new_from_login($cc,
-                                                        TABLES_ALREADY_LOCKED)
+                                                        DERIVE_GROUPS_TABLES_ALREADY_LOCKED)
               || next;
 
             next if $flag->{'target'}->{'bug'}->{'restricted'}
index 8be68f42ccce418ac5c7fbdac6b52fc1898f9506..259195720f6aa40a9c013cd8a1afcac28f0bb152 100755 (executable)
--- a/whine.pl
+++ b/whine.pl
@@ -228,9 +228,10 @@ sub get_next_event {
 
         $dbh->bz_lock_tables('whine_schedules WRITE',
                              'whine_events READ',
-                             'profiles READ',
+                             'profiles WRITE',
                              'groups READ',
-                             'user_group_map READ');
+                             'group_group_map READ',
+                             'user_group_map WRITE');
 
         # Get the event ID for the first pending schedule
         $sth_next_scheduled_event->execute;
@@ -239,7 +240,8 @@ sub get_next_event {
         return undef unless $fetched;
         my ($eventid, $owner_id, $subject, $body) = @{$fetched};
 
-        my $owner = Bugzilla::User->new($owner_id);
+        my $owner = Bugzilla::User->new($owner_id,
+                                        DERIVE_GROUPS_TABLES_ALREADY_LOCKED);
 
         my $whineatothers = $owner->in_group('bz_canusewhineatothers');