[open-ils-commits] [GIT] Evergreen ILS branch rel_2_1 updated. a97c4c3a32671987087f184bb81cc97e8bd29bdf

Evergreen Git git at git.evergreen-ils.org
Wed Jun 1 15:00:11 EDT 2011


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_2_1 has been updated
       via  a97c4c3a32671987087f184bb81cc97e8bd29bdf (commit)
       via  4f0292786c9143d47036a64e0d8fc308cce0f6dc (commit)
      from  997eef7b50acf10ec2afcb8d8933b75317e0410f (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 a97c4c3a32671987087f184bb81cc97e8bd29bdf
Author: Dan Wells <dbw2 at calvin.edu>
Date:   Wed Jun 1 14:33:59 2011 -0400

    Serial holdings display consistency fix
    
    When holdings are sourced from both MFHD and the DB, display may be
    inconsistent due to a hard-coded ', ' in Serial.pm.  This patch works around
    the problem by storing generated_coverage as a JSON array instead of a string,
    leaving display formatting to the OPAC.
    
    Signed-off-by: Dan Wells <dbw2 at calvin.edu>

diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Serial.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Serial.pm
index a08a8c3..11c3202 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Serial.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Serial.pm
@@ -15,8 +15,6 @@ use OpenSRF::Utils::Logger qw/:logger/;
 
 use Data::Dumper;
 
-use OpenSRF::Utils::JSON;
-
 use Time::HiRes qw(time);
 use OpenSRF::EX qw(:try);
 use Digest::MD5 qw(md5_hex);
@@ -27,8 +25,7 @@ use XML::LibXSLT;
 use OpenILS::Const qw/:const/;
 
 use OpenILS::Application::AppUtils;
-my $apputils = "OpenILS::Application::AppUtils";
-my $U = $apputils;
+my $U = "OpenILS::Application::AppUtils";
 
 my $pfx = "open-ils.search_";
 
@@ -149,7 +146,7 @@ sub bib_to_svr {
         if ($_->summary_method ne 'use_sre_only') {
             if (ref $_->basic_summary) { #TODO: 'show-generated' boolean on summaries
                 if ($_->basic_summary->generated_coverage) {
-                    push(@{$svr->basic_holdings}, $_->basic_summary->generated_coverage);
+                    push(@{$svr->basic_holdings}, OpenSRF::Utils::JSON->JSON2perl($_->basic_summary->generated_coverage));
                 }
                 if ($_->basic_summary->textual_holdings) {
                     push(@{$svr->basic_holdings_add}, $_->basic_summary->textual_holdings);
@@ -157,7 +154,7 @@ sub bib_to_svr {
             }
             if (ref $_->supplement_summary) {
                 if ($_->supplement_summary->generated_coverage) {
-                    push(@{$svr->supplement_holdings}, $_->supplement_summary->generated_coverage);
+                    push(@{$svr->supplement_holdings}, OpenSRF::Utils::JSON->JSON2perl($_->supplement_summary->generated_coverage));
                 }
                 if ($_->supplement_summary->textual_holdings) {
                     push(@{$svr->supplement_holdings_add}, $_->supplement_summary->textual_holdings);
@@ -165,7 +162,7 @@ sub bib_to_svr {
             }
             if (ref $_->index_summary) {
                 if ($_->index_summary->generated_coverage) {
-                    push(@{$svr->index_holdings}, $_->index_summary->generated_coverage);
+                    push(@{$svr->index_holdings}, OpenSRF::Utils::JSON->JSON2perl($_->index_summary->generated_coverage));
                 }
                 if ($_->index_summary->textual_holdings) {
                     push(@{$svr->index_holdings_add}, $_->index_summary->textual_holdings);
diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Serial.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Serial.pm
index 832d0c2..a2bab96 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Serial.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Serial.pm
@@ -1515,7 +1515,7 @@ sub _prepare_summaries {
         $cu_method = "create";
     }
 
-    $summary->generated_coverage(join(", ", @$formatted_parts));
+    $summary->generated_coverage(OpenSRF::Utils::JSON->perl2JSON($formatted_parts));
     my $method = "${cu_method}_serial_${type}_summary";
     return $e->die_event unless $e->$method($summary);
 }
diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql
index 67f185a..8baeac9 100644
--- a/Open-ILS/src/sql/Pg/002.schema.config.sql
+++ b/Open-ILS/src/sql/Pg/002.schema.config.sql
@@ -57,7 +57,7 @@ CREATE TABLE config.upgrade_log (
     install_date    TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()
 );
 
-INSERT INTO config.upgrade_log (version) VALUES ('0542'); -- phasefx
+INSERT INTO config.upgrade_log (version) VALUES ('0543'); -- dbwells
 
 CREATE TABLE config.bib_source (
 	id		SERIAL	PRIMARY KEY,
diff --git a/Open-ILS/src/sql/Pg/upgrade/0543.data.reformat_generated_coverage.sql b/Open-ILS/src/sql/Pg/upgrade/0543.data.reformat_generated_coverage.sql
new file mode 100644
index 0000000..d3efa84
--- /dev/null
+++ b/Open-ILS/src/sql/Pg/upgrade/0543.data.reformat_generated_coverage.sql
@@ -0,0 +1,18 @@
+BEGIN;
+
+-- Reformat generated_coverage to be JSON arrays rather than simple comma-
+-- separated lists.
+
+-- This upgrade script is technically imperfect, but should do the right thing
+-- in 99.9% of cases, and any mistakes will be self-healing as more serials
+-- activity happens
+
+INSERT INTO config.upgrade_log (version) VALUES ('0543'); -- dbwells
+
+UPDATE serial.basic_summary SET generated_coverage = '["' || regexp_replace(regexp_replace(generated_coverage, '"', E'\\"', 'g'), ', ', '","', 'g') || '"]' WHERE generated_coverage <> '';
+
+UPDATE serial.supplement_summary SET generated_coverage = '["' || regexp_replace(regexp_replace(generated_coverage, '"', E'\\"', 'g'), ', ', '","', 'g') || '"]' WHERE generated_coverage <> '';
+
+UPDATE serial.index_summary SET generated_coverage = '["' || regexp_replace(regexp_replace(generated_coverage, '"', E'\\"', 'g'), ', ', '","', 'g') || '"]' WHERE generated_coverage <> '';
+
+COMMIT;

commit 4f0292786c9143d47036a64e0d8fc308cce0f6dc
Author: Dan Wells <dbw2 at calvin.edu>
Date:   Wed Jun 1 14:52:49 2011 -0400

    Revert "f424dd8" for bad commit message
    
    This reverts commit 997eef7b50acf10ec2afcb8d8933b75317e0410f.

diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Serial.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Serial.pm
index 11c3202..a08a8c3 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Serial.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Search/Serial.pm
@@ -15,6 +15,8 @@ use OpenSRF::Utils::Logger qw/:logger/;
 
 use Data::Dumper;
 
+use OpenSRF::Utils::JSON;
+
 use Time::HiRes qw(time);
 use OpenSRF::EX qw(:try);
 use Digest::MD5 qw(md5_hex);
@@ -25,7 +27,8 @@ use XML::LibXSLT;
 use OpenILS::Const qw/:const/;
 
 use OpenILS::Application::AppUtils;
-my $U = "OpenILS::Application::AppUtils";
+my $apputils = "OpenILS::Application::AppUtils";
+my $U = $apputils;
 
 my $pfx = "open-ils.search_";
 
@@ -146,7 +149,7 @@ sub bib_to_svr {
         if ($_->summary_method ne 'use_sre_only') {
             if (ref $_->basic_summary) { #TODO: 'show-generated' boolean on summaries
                 if ($_->basic_summary->generated_coverage) {
-                    push(@{$svr->basic_holdings}, OpenSRF::Utils::JSON->JSON2perl($_->basic_summary->generated_coverage));
+                    push(@{$svr->basic_holdings}, $_->basic_summary->generated_coverage);
                 }
                 if ($_->basic_summary->textual_holdings) {
                     push(@{$svr->basic_holdings_add}, $_->basic_summary->textual_holdings);
@@ -154,7 +157,7 @@ sub bib_to_svr {
             }
             if (ref $_->supplement_summary) {
                 if ($_->supplement_summary->generated_coverage) {
-                    push(@{$svr->supplement_holdings}, OpenSRF::Utils::JSON->JSON2perl($_->supplement_summary->generated_coverage));
+                    push(@{$svr->supplement_holdings}, $_->supplement_summary->generated_coverage);
                 }
                 if ($_->supplement_summary->textual_holdings) {
                     push(@{$svr->supplement_holdings_add}, $_->supplement_summary->textual_holdings);
@@ -162,7 +165,7 @@ sub bib_to_svr {
             }
             if (ref $_->index_summary) {
                 if ($_->index_summary->generated_coverage) {
-                    push(@{$svr->index_holdings}, OpenSRF::Utils::JSON->JSON2perl($_->index_summary->generated_coverage));
+                    push(@{$svr->index_holdings}, $_->index_summary->generated_coverage);
                 }
                 if ($_->index_summary->textual_holdings) {
                     push(@{$svr->index_holdings_add}, $_->index_summary->textual_holdings);
diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Serial.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Serial.pm
index a2bab96..832d0c2 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Serial.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Serial.pm
@@ -1515,7 +1515,7 @@ sub _prepare_summaries {
         $cu_method = "create";
     }
 
-    $summary->generated_coverage(OpenSRF::Utils::JSON->perl2JSON($formatted_parts));
+    $summary->generated_coverage(join(", ", @$formatted_parts));
     my $method = "${cu_method}_serial_${type}_summary";
     return $e->die_event unless $e->$method($summary);
 }
diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql
index 8baeac9..67f185a 100644
--- a/Open-ILS/src/sql/Pg/002.schema.config.sql
+++ b/Open-ILS/src/sql/Pg/002.schema.config.sql
@@ -57,7 +57,7 @@ CREATE TABLE config.upgrade_log (
     install_date    TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()
 );
 
-INSERT INTO config.upgrade_log (version) VALUES ('0543'); -- dbwells
+INSERT INTO config.upgrade_log (version) VALUES ('0542'); -- phasefx
 
 CREATE TABLE config.bib_source (
 	id		SERIAL	PRIMARY KEY,
diff --git a/Open-ILS/src/sql/Pg/upgrade/0543.data.reformat_generated_coverage.sql b/Open-ILS/src/sql/Pg/upgrade/0543.data.reformat_generated_coverage.sql
deleted file mode 100644
index d3efa84..0000000
--- a/Open-ILS/src/sql/Pg/upgrade/0543.data.reformat_generated_coverage.sql
+++ /dev/null
@@ -1,18 +0,0 @@
-BEGIN;
-
--- Reformat generated_coverage to be JSON arrays rather than simple comma-
--- separated lists.
-
--- This upgrade script is technically imperfect, but should do the right thing
--- in 99.9% of cases, and any mistakes will be self-healing as more serials
--- activity happens
-
-INSERT INTO config.upgrade_log (version) VALUES ('0543'); -- dbwells
-
-UPDATE serial.basic_summary SET generated_coverage = '["' || regexp_replace(regexp_replace(generated_coverage, '"', E'\\"', 'g'), ', ', '","', 'g') || '"]' WHERE generated_coverage <> '';
-
-UPDATE serial.supplement_summary SET generated_coverage = '["' || regexp_replace(regexp_replace(generated_coverage, '"', E'\\"', 'g'), ', ', '","', 'g') || '"]' WHERE generated_coverage <> '';
-
-UPDATE serial.index_summary SET generated_coverage = '["' || regexp_replace(regexp_replace(generated_coverage, '"', E'\\"', 'g'), ', ', '","', 'g') || '"]' WHERE generated_coverage <> '';
-
-COMMIT;

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

Summary of changes:


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list