]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1481106 - Start logging bug_user_last_visit for all visited bugs even if the...
authorKohei Yoshino <kohei.yoshino@gmail.com>
Fri, 29 Mar 2019 03:16:21 +0000 (23:16 -0400)
committerDylan William Hardison <dylan@hardison.net>
Fri, 29 Mar 2019 03:16:21 +0000 (23:16 -0400)
Bugzilla/Bug.pm
Bugzilla/WebService/BugUserLastVisit.pm
Bugzilla/WebService/Constants.pm
extensions/BugModal/template/en/default/bug_modal/header.html.tmpl
template/en/default/bug/show-header.html.tmpl
template/en/default/global/user-error.html.tmpl

index 4e6bfa8fb36fb29eb5cd41e4c850b7067a8737a0..ac96a7729d9e14db9b87d0663c88ee94e86791ac 100644 (file)
@@ -1399,17 +1399,6 @@ sub update {
     $self->{delta_ts} = $delta_ts;
   }
 
-  # Update last-visited
-  if ($user->is_involved_in_bug($self)) {
-    $self->update_user_last_visit($user, $delta_ts);
-  }
-
-  # If a user is no longer involved, remove their last visit entry
-  my $last_visits = Bugzilla::BugUserLastVisit->match({bug_id => $self->id});
-  foreach my $lv (@$last_visits) {
-    $lv->remove_from_db() unless $lv->user->is_involved_in_bug($self);
-  }
-
   # Update bug ignore data if user wants to ignore mail for this bug
   if (exists $self->{'bug_ignored'}) {
     my $bug_ignored_changed;
index 9b4261bc3421a9a54e6c358cfe8e143a7fb3c158..62a02505ead2f1188740e8e8bca85e5d3493dbfc 100644 (file)
@@ -44,8 +44,7 @@ sub update {
   foreach my $bug_id (@$ids) {
     my $bug = Bugzilla::Bug->check({id => $bug_id, cache => 1});
 
-    ThrowUserError('user_not_involved', {bug_id => $bug->id})
-      unless $user->is_involved_in_bug($bug);
+    next unless $user->can_see_bug($bug->id);
 
     $bug->update_user_last_visit($user, $last_visit_ts);
 
index cb44aae85180721862137dc959cbf246940d5868..d1b1b52f806dc1d76e4556bd859a1ad38fa61e9b 100644 (file)
@@ -219,9 +219,6 @@ use constant WS_ERROR_CODE => {
   # Search errors are 1000-1100
   buglist_parameters_required => 1000,
 
-  # BugUserLastVisited errors
-  user_not_involved => 1300,
-
   # Job queue errors 1400-1500
   jobqueue_status_error => 1400,
 
index 675082a50b71f3d053a277261df5b0e3340c34e0..cbc3acd5b472580ff6f64ed319ff2f642c90d246 100644 (file)
@@ -83,7 +83,7 @@
   [% END %]
 
   [%# update last-visited %]
-  [% IF user.id && user.is_involved_in_bug(bug) %]
+  [% IF user.id %]
     document.addEventListener('DOMContentLoaded', () => show_new_changes_indicator(), { once: true });
   [% END %]
 
index 560b6179d96ccf5aa19a5811b0ae026eeb2997e3..2c8ac8f4e321b2169547ec886932c191734714cd 100644 (file)
@@ -67,7 +67,7 @@
     YAHOO.util.Event.onDOMReady(function() {
       initDirtyFieldTracking();
 
-      [% IF user.id AND user.is_involved_in_bug(bug) %]
+      [% IF user.id %]
         YAHOO.bugzilla.bugUserLastVisit.update([ [% bug.bug_id FILTER none %] ]);
       [% END %]
     });
index 3bdb5c6a856a381b727e4dc767411dee82e4aaa9..fb45ba7849ab392612fcc634ce3a5e8949f37d4a 100644 (file)
     Sorry, but you are not allowed to (un)mark comments or attachments
     as private.
 
-  [% ELSIF error == "user_not_involved" %]
-    [% title = "User Not Involved with $terms.Bug" %]
-    Sorry, but you are not involved with [% terms.Bug %] [%+
-        bug_id FILTER bug_link(bug_id) FILTER none %].
-
   [% ELSIF error == "webdot_too_large" %]
     [% title = "Dependency Graph Too Large" %]
     The dependency graph contains too many [% terms.bugs %] to display (more