From: Jeff Davis Date: Thu, 25 Feb 2016 20:07:31 +0000 (-0800) Subject: LP#1017990: Deprecate open-ils.circ.holds.create[.override] API calls X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=refs%2Fheads%2Fuser%2Fjeffdavis%2Flp1017990-deprecate-hold-create;p=working%2FEvergreen.git LP#1017990: Deprecate open-ils.circ.holds.create[.override] API calls Per discussion on Launchpad, the open-ils.circ.holds.create and open-ils.circ.holds.create.override API calls are now deprecated. This commit adds a WARN-level log message about the deprecation, moves the implementation code to a separate method, and makes EG use the implementation method directly rather than invoking the deprecated API calls. Signed-off-by: Jeff Davis --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm index 65c3a6fe97..979af40394 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm @@ -114,11 +114,7 @@ sub test_and_create_hold_batch { } my $ahr = construct_hold_request_object($params); - my ($res2) = $self->method_lookup( - $override - ? 'open-ils.circ.holds.create.override' - : 'open-ils.circ.holds.create' - )->run($auth, $ahr, $oargs); + my ($res2) = create_hold_impl($self, $auth, $ahr, $override, $oargs); $res2 = { 'target' => $$params{$target_field}, 'result' => $res2 @@ -244,14 +240,22 @@ __PACKAGE__->register_method( sub create_hold { my( $self, $conn, $auth, $hold, $oargs ) = @_; return -1 unless $hold; - my $e = new_editor(authtoken=>$auth, xact=>1); - return $e->die_event unless $e->checkauth; + + $logger->warn($self->api_name . " is deprecated and will be removed in the next release"); my $override = 0; if ($self->api_name =~ /override/) { $override = 1; $oargs = { all => 1 } unless defined $oargs; } + return create_hold_impl($self, $auth, $hold, $override, $oargs); +} + +sub create_hold_impl { + my( $self, $auth, $hold, $override, $oargs ) = @_; + return -1 unless $hold; + my $e = new_editor(authtoken=>$auth, xact=>1); + return $e->die_event unless $e->checkauth; my @events;