Closed Bug 1032883 Opened 6 years ago Closed 6 years ago

update FlagDefaultRequestee extension to use object hooks

Categories

(bugzilla.mozilla.org :: Extensions, defect)

Production
x86
macOS
defect
Not set

Tracking

()

RESOLVED FIXED

People

(Reporter: glob, Assigned: glob)

Details

Attachments

(1 file)

the FlagDefaultRequestee extension doesn't use object hooks to add the default_requestee field, which results in a large number of redundant database queries.

we need to update it to use object_* hooks.
Attached patch 1032883_1.patchSplinter Review
Attachment #8448796 - Flags: review?(dkl)
Comment on attachment 8448796 [details] [diff] [review]
1032883_1.patch

Review of attachment 8448796 [details] [diff] [review]:
-----------------------------------------------------------------

Fixes on commit. r=dkl

::: extensions/FlagDefaultRequestee/Extension.pm
@@ +25,4 @@
>  
>  sub install_update_db {
>      my $dbh = Bugzilla->dbh;
> +    dbh->bz_add_column('flagtypes', 'default_requestee', {

s/dbh/$dbh/

Can't locate object method "bz_add_column" via package "dbh" (perhaps you forgot to load "dbh"?) at ./extensions/FlagDefaultRequestee/Extension.pm line 28.

@@ +153,5 @@
> +
> +    $changes->{default_requestee} = [
> +        $old_id ? $old_id : undef,
> +        $new_id ? $new_id : undef
> +    ];

Get rid of this unless you are going to alter template/en/default/messages.html.tmpl to show the old and new values. If yes, then change to user names instead of ids.
Attachment #8448796 - Flags: review?(dkl) → review+
(In reply to David Lawrence [:dkl] from comment #2)
> Get rid of this unless you are going to alter
> template/en/default/messages.html.tmpl to show the old and new values. If
> yes, then change to user names instead of ids.

nice catch; i opted to fix the 'updated' messages.

To ssh://gitolite3@git.mozilla.org/webtools/bmo/bugzilla.git
   b2af966..a6b6a99  master -> master
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Component: Extensions: Other → Extensions
You need to log in before you can comment on or make changes to this bug.