LP#1682296: Avoid database query error on serials batch receive
authorJeff Davis <jdavis@sitka.bclibraries.ca>
Mon, 22 May 2017 20:26:10 +0000 (13:26 -0700)
committerGalen Charlton <gmc@equinoxinitiative.org>
Mon, 30 Apr 2018 14:54:46 +0000 (10:54 -0400)
To test
-------
[1] Example Search -> Retrieve title by database ID -> Actions
    for this Record -> Serials Batch Receive -> Next ->
    this works as expected & receivable issues are listed.
[2] Click on "Start Over"; you are prompted to "Enter an identifier
    for a bibliographic record" this is where the search fails

    Example enter "109242427" results in two errors.

[3] Desired behavior - If you enter a database ID or ISSN in the
    "Enter an identifier for a bibliographic record" field the
    receivable issuances should be displayed

Signed-off-by: Jeff Davis <jdavis@sitka.bclibraries.ca>
Signed-off-by: Cesar Velez <cesar.velez@equinoxinitiative.org>
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Open-ILS/src/perlmods/lib/OpenILS/Application/Serial.pm

index 3a9aaec..f0b10d2 100644 (file)
@@ -3637,7 +3637,7 @@ sub bre_by_identifier {
         $search->disconnect;
 
         # Un-nest results. They tend to look like [[1],[2],[3]] for some reason.
-        @ids = map { @{$_} } @{$search_result->{"ids"}};
+        @ids = map { @{$_}[0] } @{$search_result->{"ids"}};
 
         unless (@ids) {
             $e->disconnect;