On Thu, 2009-10-08 at 07:30 -0700, Kristis Makris wrote:
> Thanks a lot for the feedback! This may just be the root of the problem.
> We had not investigated if modules were coming from Bugzilla/lib before.

Well. I had to make the thing working against Bugzilla 3.4 and here are
other observations.
My previous patch for Bugzilla not found is incorrect. It works only if
scmbug daemon was started from Bugzilla's directory. I changed it to
better form (see attachment), but it's architecture specific and I don't
know how to do this correctly in Perl.
There was an error in Bugzilla.pm that prevented adding comment to
Bugzilla because of authorization problems. It was caused by running
Bug->check() before creating Bugzilla::User() which caused rejection in
bugzilla's Bug->check_is_visible() function. After bit of reorganization,
it works for me and appends new comments to SVN and Bugzilla.

> In the future please send all communication to the mailing list.

OK.
Thanks for Scmbug anyway. Very useful piece of code.

-- 
Michal Kašpar
--- /home/mkaspar/Bugzilla.pm	2009-10-08 08:43:27.000000000 +0200
+++ /usr/share/scmbug/lib/Scmbug/Daemon/Bugzilla.pm	2009-10-08 14:01:47.000000000 +0200
@@ -121,6 +121,9 @@
     my $package_name = "";
     my $package_version = "";
 
+    # I don't know, how to do this correctly but works for me, which is enough for now
+    unshift @INC, $self->installation_directory()."/lib/x86_64-linux-thread-multi";
+    unshift @INC, $self->installation_directory()."/lib";
     # Include the bugzilla libraries
     unshift @INC, $self->installation_directory();
     chdir $self->installation_directory();
@@ -551,9 +554,11 @@
         # since Bugzilla 3.1.3 AppendComment has been replaced by add_comment
 	my $userid = Bugzilla::User::login_to_id( $username );
 	if ( $userid > 0 ) {
-            my $bug = Bugzilla::Bug->check($bugid);
+            # first create user instance as it is used in Bug->check 
+            # to evaluate Bug's visibility
             my $user = new Bugzilla::User($userid);
             Bugzilla->set_user($user);
+            my $bug = Bugzilla::Bug->check($bugid);
             $bug->add_comment($comment, {isprivate => 0, work_time => 0, type => Bugzilla::Constants->CMT_NORMAL, extra_data => ""} );
             $bug->update();
 	    return 0;

_______________________________________________
scmbug-users mailing list
[email protected]
http://lists.mkgnu.net/cgi-bin/mailman/listinfo/scmbug-users

Reply via email to