Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
bugzilla
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
bugzilla
Commits
e2477726
Commit
e2477726
authored
Dec 15, 2015
by
Dylan Hardison
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 1169181 - The bug_user_last_visit method returns an empty array for old bugs
r=dkl,a=dkl
parent
979ba53d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
16 deletions
+13
-16
User.pm
Bugzilla/User.pm
+3
-2
BugUserLastVisit.pm
Bugzilla/WebService/BugUserLastVisit.pm
+10
-14
No files found.
Bugzilla/User.pm
View file @
e2477726
...
...
@@ -922,9 +922,10 @@ sub groups {
}
sub
last_visited
{
my
(
$self
)
=
@_
;
my
(
$self
,
$ids
)
=
@_
;
return
Bugzilla::
BugUserLastVisit
->
match
({
user_id
=>
$self
->
id
});
return
Bugzilla::
BugUserLastVisit
->
match
({
user_id
=>
$self
->
id
,
$ids
?
(
bug_id
=>
$ids
)
:
()
});
}
sub
is_involved_in_bug
{
...
...
Bugzilla/WebService/BugUserLastVisit.pm
View file @
e2477726
...
...
@@ -52,7 +52,7 @@ sub update {
push
(
@results
,
$self
->
_bug_user_last_visit_to_hash
(
$bug
,
$last_visit_ts
,
$params
$bug
->
id
,
$last_visit_ts
,
$params
));
}
$dbh
->
bz_commit_transaction
();
...
...
@@ -67,27 +67,23 @@ sub get {
$user
->
login
(
LOGIN_REQUIRED
);
my
@last_visits
;
if
(
$ids
)
{
# Cache permissions for bugs. This highly reduces the number of calls to
# the DB. visible_bugs() is only able to handle bug IDs, so we have to
# skip aliases.
$user
->
visible_bugs
([
grep
/^[0-9]$/
,
@$ids
]);
}
my
@last_visits
=
@
{
$user
->
last_visited
};
if
(
$ids
)
{
# remove bugs that we are not interested in if ids is passed in.
my
%
id_set
=
map
{
(
$_
=>
1
)
}
@$ids
;
@last_visits
=
grep
{
$id_set
{
$_
->
bug_id
}
}
@last_visits
;
my
%
last_visit
=
map
{
$_
->
bug_id
=>
$_
->
last_visit_ts
}
@
{
$user
->
last_visited
(
$ids
)
};
@last_visits
=
map
{
$self
->
_bug_user_last_visit_to_hash
(
$_
->
id
,
$last_visit
{
$_
},
$params
)
}
@$ids
;
}
else
{
@last_visits
=
map
{
$self
->
_bug_user_last_visit_to_hash
(
$_
->
bug_id
,
$_
->
last_visit_ts
,
$params
)
}
@
{
$user
->
last_visited
};
}
return
[
map
{
$self
->
_bug_user_last_visit_to_hash
(
$_
->
bug_id
,
$_
->
last_visit_ts
,
$params
)
}
@last_visits
];
return
\
@last_visits
;
}
sub
_bug_user_last_visit_to_hash
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment