KMAIN-318 Holds count fix
authorBill Erickson <berickxx@gmail.com>
Wed, 29 Oct 2014 21:06:27 +0000 (17:06 -0400)
committerBill Erickson <berickxx@gmail.com>
Thu, 21 Mar 2019 19:46:23 +0000 (15:46 -0400)
    Cross-port: ffb13a0

Conflicts:
Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm

Moved custom rec_hold_count() code to a new rec_hold_count_kcls()
to reduce merge conflicts going forward function.

Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm

index 4ba9c3a..0a1d023 100644 (file)
@@ -4148,7 +4148,7 @@ sub change_hold_title_for_specific_holds {
 }
 
 __PACKAGE__->register_method(
-    method    => 'rec_hold_count',
+    method    => 'rec_hold_count_kcls',
     api_name  => 'open-ils.circ.bre.holds.count',
     signature => {
         desc => q/Returns the total number of holds that target the
@@ -4166,7 +4166,7 @@ __PACKAGE__->register_method(
 );
 
 __PACKAGE__->register_method(
-    method    => 'rec_hold_count',
+    method    => 'rec_hold_count_kcls',
     api_name  => 'open-ils.circ.mmr.holds.count',
     signature => {
         desc => q/Returns the total number of holds that target the
@@ -4309,6 +4309,13 @@ sub rec_hold_count {
     return new_editor()->json_query($query)->[0]->{count};
 }
 
+# moved custom code into separate function to reduce merge conflicts
+sub rec_hold_count_kcls {
+    my($self, $conn, $target_id) = @_;
+    my $result = new_editor()->json_query({from => ['action.get_hold_count', $target_id]})->[0];
+    return [values %$result]->[0];
+}
+
 # A helper function to calculate a hold's expiration time at a given
 # org_unit. Takes the org_unit as an argument and returns either the
 # hold expire time as an ISO8601 string or undef if there is no hold