From 646aa223346440a159effc37b0e6070832b1989a Mon Sep 17 00:00:00 2001 From: Sunil Joshi Date: Thu, 26 Sep 2013 12:04:59 +1000 Subject: Bug 714523 - editversions.cgi should use ->set_all r=simon, a=simon --- Bugzilla/Version.pm | 10 +++++----- editversions.cgi | 6 ++++-- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Bugzilla/Version.pm b/Bugzilla/Version.pm index 920853ecd..317b73d95 100644 --- a/Bugzilla/Version.pm +++ b/Bugzilla/Version.pm @@ -169,8 +169,8 @@ sub product { # Validators ################################ -sub set_name { $_[0]->set('value', $_[1]); } -sub set_is_active { $_[0]->set('isactive', $_[1]); } +sub set_value { $_[0]->set('value', $_[1]); } +sub set_isactive { $_[0]->set('isactive', $_[1]); } sub _check_value { my ($invocant, $name, undef, $params) = @_; @@ -219,7 +219,7 @@ Bugzilla::Version - Bugzilla product version class. my $version = Bugzilla::Version->create( { value => $name, product => $product_obj }); - $version->set_name($new_name); + $version->set_value($new_name); $version->update(); $version->remove_from_db; @@ -255,9 +255,9 @@ below. =item DEFAULT_VERSION -=item set_is_active +=item set_isactive -=item set_name +=item set_value =item product_id diff --git a/editversions.cgi b/editversions.cgi index 1d056c67b..06f2f580c 100755 --- a/editversions.cgi +++ b/editversions.cgi @@ -188,8 +188,10 @@ if ($action eq 'update') { $dbh->bz_start_transaction(); - $version->set_name($version_name); - $version->set_is_active($isactive); + $version->set_all({ + value => $version_name, + isactive => $isactive + }); my $changes = $version->update(); $dbh->bz_commit_transaction(); -- cgit v1.2.3-24-g4f1b