From: miker Date: Fri, 10 Dec 2010 05:03:25 +0000 (+0000) Subject: Fix two bugs: X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=d029d6b37b3f00e801aa6dc0be88e38b1c0111a7;p=evergreen%2Fjoelewis.git Fix two bugs: * Wide Character warning in authority.generate_overlay_template due to the generated template not being UTF-8 encoded internally * Correctly test the same space-normalization form of the pre- and post-strip records during the application of a replace rule in vandelay.replace_field NOTE: to be backported to rel_2_0 and rel_1_6 git-svn-id: svn://svn.open-ils.org/ILS/trunk@18957 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql index 22e3e0866c..a5dcd7d4f4 100644 --- a/Open-ILS/src/sql/Pg/002.schema.config.sql +++ b/Open-ILS/src/sql/Pg/002.schema.config.sql @@ -70,7 +70,7 @@ CREATE TABLE config.upgrade_log ( install_date TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW() ); -INSERT INTO config.upgrade_log (version) VALUES ('0468'); -- gmc +INSERT INTO config.upgrade_log (version) VALUES ('0469'); -- miker CREATE TABLE config.bib_source ( id SERIAL PRIMARY KEY, diff --git a/Open-ILS/src/sql/Pg/011.schema.authority.sql b/Open-ILS/src/sql/Pg/011.schema.authority.sql index b4691f2077..bc11a446b0 100644 --- a/Open-ILS/src/sql/Pg/011.schema.authority.sql +++ b/Open-ILS/src/sql/Pg/011.schema.authority.sql @@ -132,6 +132,7 @@ CREATE OR REPLACE FUNCTION authority.generate_overlay_template ( TEXT, BIGINT ) return undef unless ($id); # We need an ID! my $tmpl = MARC::Record->new(); + $tmpl->encoding( 'UTF-8' ); my @rule_fields; for my $field ( $r->field( '1..' ) ) { # Get main entry fields from the authority record diff --git a/Open-ILS/src/sql/Pg/012.schema.vandelay.sql b/Open-ILS/src/sql/Pg/012.schema.vandelay.sql index 9ca76805e1..769e790451 100644 --- a/Open-ILS/src/sql/Pg/012.schema.vandelay.sql +++ b/Open-ILS/src/sql/Pg/012.schema.vandelay.sql @@ -444,10 +444,12 @@ $_$ LANGUAGE PLPERLU; CREATE OR REPLACE FUNCTION vandelay.replace_field ( target_xml TEXT, source_xml TEXT, field TEXT ) RETURNS TEXT AS $_$ DECLARE xml_output TEXT; + parsed_target TEXT; BEGIN - xml_output := vandelay.strip_field( target_xml, field); + parsed_target := vandelay.strip_field( target_xml, ''); -- this dance normalized the format of the xml for the IF below + xml_output := vandelay.strip_field( parsed_target, field); - IF xml_output <> target_xml AND field ~ E'~' THEN + IF xml_output <> parsed_target AND field ~ E'~' THEN -- we removed something, and there was a regexp restriction in the field definition, so proceed xml_output := vandelay.add_field( xml_output, source_xml, field, 1 ); ELSIF field !~ E'~' THEN diff --git a/Open-ILS/src/sql/Pg/1.6.1-2.0-upgrade-db.sql b/Open-ILS/src/sql/Pg/1.6.1-2.0-upgrade-db.sql index 8beae96586..ed2f5883a0 100644 --- a/Open-ILS/src/sql/Pg/1.6.1-2.0-upgrade-db.sql +++ b/Open-ILS/src/sql/Pg/1.6.1-2.0-upgrade-db.sql @@ -31,7 +31,7 @@ UPDATE biblio.record_entry SET marc = '