[open-ils-commits] [GIT] Evergreen ILS branch rel_3_0 updated. d5a8a5288d26d86355c2fa7b046a928ab6e25ddb

Evergreen Git git at git.evergreen-ils.org
Thu Jan 11 14:14:46 EST 2018


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, rel_3_0 has been updated
       via  d5a8a5288d26d86355c2fa7b046a928ab6e25ddb (commit)
      from  17685311d8350f7bbc61f1d0e394ec457c061789 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit d5a8a5288d26d86355c2fa7b046a928ab6e25ddb
Author: Dan Wells <dbw2 at calvin.edu>
Date:   Wed Dec 27 08:36:23 2017 -0500

    LP#1730470 Restore XUL serial receive compatibility
    
    The older XUL interface does not have quite the same fleshing as the
    new web-staff, so adding the 'move previous' code into the unitize
    function breaks the old interface.
    
    Since we already are looking up the distribution to get the setting,
    let's just tack it on when it is missing.
    
    To test
    -------
    [1] Set up a serial subscription with predicted issuances, then from
        the XUL serials control view attempt to receive an issue. Note
        that there will be a crash.
    [2] Apply the patch and repeat step #1; this time, the issuance
        receive should work.
    [3] Verify that receiving issues via the web staff interface continues
        to work.
    
    Signed-off-by: Dan Wells <dbw2 at calvin.edu>
    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>
    Signed-off-by: Mike Rylander <mrylander at gmail.com>

diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Serial.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Serial.pm
index 04f79c0..3a9aaec 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Serial.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Serial.pm
@@ -1446,13 +1446,13 @@ sub unitize_items {
         return $evt if $evt;
 
         if ($mode eq 'receive') {
-            my $sdists = $editor->search_serial_distribution([
+            my $sdist = $editor->search_serial_distribution([
                 {"+sstr" => {"id" => $stream_id}},
                 {
                     "join" => {"sstr" => {}},
                     "flesh" => 1,
                     "flesh_fields" => {"sdist" => ["subscription"]}
-                }]);
+                }])->[0];
 
             #-------------------------------------------------------------------------
             # The following is copied from open-ils.serial.receive_items.one_unit_per
@@ -1462,6 +1462,13 @@ sub unitize_items {
             # issuance).  This will be used in up to two places: once when building
             # a summary, once when changing the copy location of the previous
             # issuance's copy.
+
+            # manually flesh distribution if not present
+            #
+            # this helps maintain compatiblity with XUL serial control receive
+            if (!ref($item->stream->distribution)) {
+                $item->stream->distribution($sdist);
+            }
             my $issuances_received = _issuances_received($editor, $item);
             if ($U->event_code($issuances_received)) {
                 $editor->rollback;
@@ -1469,7 +1476,7 @@ sub unitize_items {
             }
     
             # Find out if we need to to deal with previous copy location changing.
-            my $ou = $sdists->[0]->holding_lib;
+            my $ou = $sdist->holding_lib;
             unless (exists $prev_loc_setting_map->{$ou}) {
                 $prev_loc_setting_map->{$ou} = $U->ou_ancestor_setting_value(
                     $ou, "serial.prev_issuance_copy_location", $editor

-----------------------------------------------------------------------

Summary of changes:
 .../src/perlmods/lib/OpenILS/Application/Serial.pm |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list