diff options
-rw-r--r-- | Bugzilla/Search/Recent.pm | 12 | ||||
-rw-r--r-- | Bugzilla/User.pm | 3 |
2 files changed, 14 insertions, 1 deletions
diff --git a/Bugzilla/Search/Recent.pm b/Bugzilla/Search/Recent.pm index 6e24bd5bc..d7d595ecc 100644 --- a/Bugzilla/Search/Recent.pm +++ b/Bugzilla/Search/Recent.pm @@ -90,6 +90,18 @@ sub check { return $search; } +sub new_from_cookie { + my ($invocant, $bug_ids) = @_; + my $class = ref($invocant) || $invocant; + + my $search = { id => 'cookie', + user_id => Bugzilla->user->id, + bug_list => join(',', @$bug_ids) }; + + bless $search, $class; + return $search; +} + #################### # Simple Accessors # #################### diff --git a/Bugzilla/User.pm b/Bugzilla/User.pm index 1dc03a9c7..bf0a9e7e9 100644 --- a/Bugzilla/User.pm +++ b/Bugzilla/User.pm @@ -425,7 +425,8 @@ sub recent_search_for { if (my $list = $cgi->cookie('BUGLIST')) { my @bug_ids = split(':', $list); if (grep { $_ == $bug->id } @bug_ids) { - return { id => 'cookie', bug_list => \@bug_ids }; + my $search = Bugzilla::Search::Recent->new_from_cookie(\@bug_ids); + return $search; } } |