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

Evergreen Git git at git.evergreen-ils.org
Wed Jul 11 14:29:08 EDT 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  34995670769210df9b54a03212ce496dae709e19 (commit)
       via  97422ed57cdab35625e4274ebfb305180c06736c (commit)
      from  0a9e00ed0ada77c89b4b0a10600a49e1989ccf10 (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 34995670769210df9b54a03212ce496dae709e19
Author: Galen Charlton <gmc at equinoxinitiative.org>
Date:   Thu Jan 25 14:57:40 2018 -0500

    LP#1745462: avoid trying to validate empty fields
    
    This patch is the belt to the previous patch's suspenders and ensures
    that the web staff client does not attempt to authority-validate headings
    fields in the MARC editor if they're empty (i.e., no subfield values).
    
    To test
    -------
    [1] In the web staff client, create a new bib. Ensure that at least one of the
        authority-controlled fields has no subfield values.
    [2] Hit the Validate button.
    [3] Note that the field(s) with empty headings show the tick
        mark indicating that they've been "validated".
    [4] Apply the patch and repeat steps 1 and 2. This time, empty headings
        field should not be checked.
    [5] Verify that validating headings that are not empty does continue
        to work.
    
    Patch inspired by Mike Rylander.
    
    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>
    Signed-off-by: Chris Sharp <csharp at georgialibraries.org>

diff --git a/Open-ILS/web/js/ui/default/staff/cat/services/marcedit.js b/Open-ILS/web/js/ui/default/staff/cat/services/marcedit.js
index 5720f4a..6e873ff 100644
--- a/Open-ILS/web/js/ui/default/staff/cat/services/marcedit.js
+++ b/Open-ILS/web/js/ui/default/staff/cat/services/marcedit.js
@@ -1318,6 +1318,7 @@ angular.module('egMarcMod', ['egCoreMod', 'ui.bootstrap'])
                             return;
                         }
                         var auth_match = $scope.controlSet.bibToAuthorities(f);
+                        if (auth_match.length == 0) return;
                         chain = chain.then(function() {
                             var promise = egCore.net.request(
                                 'open-ils.search',
diff --git a/Open-ILS/web/js/ui/default/staff/cat/services/tagtable.js b/Open-ILS/web/js/ui/default/staff/cat/services/tagtable.js
index 85b2e32..90d894c 100644
--- a/Open-ILS/web/js/ui/default/staff/cat/services/tagtable.js
+++ b/Open-ILS/web/js/ui/default/staff/cat/services/tagtable.js
@@ -461,10 +461,16 @@ function($q,   egCore,   egAuth) {
                 var sflist = [];                
                 for (var i = 0; i < field.subfields.length; i++) {
                     if (af.sf_list().indexOf(field.subfields[i][0]) > -1) {
-                        sflist.push(field.subfields[i]);
+                        if (typeof(field.subfields[i][1]) != 'undefined'
+                            && field.subfields[i][1] !== null
+                            && field.subfields[i][1].length > 0
+                        ) {
+                                sflist.push(field.subfields[i]);
+                        }
                     }
                 }
-    
+                if (sflist.length == 0) return null;
+
                 var m = new MARC21.Record ({rtype:'AUT'});
                 m.appendFields(
                     new MARC21.Field ({

commit 97422ed57cdab35625e4274ebfb305180c06736c
Author: Galen Charlton <gmc at equinoxinitiative.org>
Date:   Thu Jan 25 14:40:47 2018 -0500

    LP#1745462: guard against scanning entire authority table
    
    This patch ensures that if, for whatever reason, a MARC editor headings
    validation action includes a field whose subfield values are empty, it
    ignores any cases where the normalized heading works out to NULL or the
    empty string. Otherwise, the database can be asked to fetch the IDs
    of most/all records in the database, and open-ils.cstore backend can be
    asked to store the entire result set in memory.
    
    To test
    -------
    [0] Ensure that statement logging is turned on in the PostgreSQL database.
    [1] In the web staff client, create a new bib. Ensure that at least one of the
        authority-controlled fields has no subfield values.
    [2] Hit the Validate button.
    [3] Note that the following query is logged by the database:
    
    SELECT "are".id AS "id" FROM authority.record_entry AS "are"
    WHERE "are".control_set = '1'
    AND "are".deleted = 'f' AND "are".simple_heading IS NOT NULL;
    
    [4] Apply the patch and repeat steps 1 and 2. This time, note that
        no such query is recorded.
    [5] Verify that validating headings that are not empty does continue
        to work.
    
    Signed-off-by: Galen Charlton <gmc at equinoxinitiative.org>
    Signed-off-by: Chris Sharp <csharp at georgialibraries.org>

diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Authority.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Authority.pm
index a20dfb1..2e90ae2 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Authority.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Authority.pm
@@ -73,6 +73,10 @@ sub search_authority_by_simple_normalize_heading {
     my $e = new_editor();
     my $norm_heading = $e->json_query($norm_heading_query)->[0]->{'authority.simple_normalize_heading'};
 
+    unless (defined($norm_heading) && $norm_heading != '') {
+        return OpenILS::Event->new('BAD_PARAMS', note => 'Heading normalized to null or empty string');
+    }
+
     my $query = {
         select => { are => ['id'] },
         from   => 'are',

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

Summary of changes:
 .../lib/OpenILS/Application/Search/Authority.pm    |    4 ++++
 .../js/ui/default/staff/cat/services/marcedit.js   |    1 +
 .../js/ui/default/staff/cat/services/tagtable.js   |   10 ++++++++--
 3 files changed, 13 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list