[open-ils-commits] [GIT] Evergreen ILS branch rel_2_2 updated. 03167d0719938f6fcf14dfe648fdeb4c0b70c3a5
Evergreen Git
git at git.evergreen-ils.org
Tue Jun 12 16:45:43 EDT 2012
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_2 has been updated
via 03167d0719938f6fcf14dfe648fdeb4c0b70c3a5 (commit)
from 6689a84cce89f60cbac8d0cc55be018043c0da5f (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 03167d0719938f6fcf14dfe648fdeb4c0b70c3a5
Author: Mike Rylander <mrylander at gmail.com>
Date: Fri Jun 8 09:26:25 2012 -0400
Remove unsafe thesaurus/control-set mapping
Evergreen 2.2 and beyond includes new Authority Control Set functionality
intended to allow the definition of locally defined authority control
headings. The primary mechanism for determining which Control Set is used
by any given authority record is to look at the thesaurus fixed field
(mnemonic: Subj), which currently must be uniquely linked to a Control Set.
Failing that (in the case of no thesaurus code at all), there is a backup
mechanism: if the thesaurus value for the authority record is missing or not
used by any configured Control Set then Evergreen will look at the first Main
Entry (1xx) field in the record, and find a control set which uses this field.
This is, obviously, not perfect, but for non-overlapping authority field
schemes, it works very well.
However, the seed data for Evergreen currently includes the "no attempt to
code" value of "|" in the set of thesauri that point to the LoC Control Set.
This value ("|") is also the default value for the Subj fixed field. This
means that the fallback mechanism is very likely never reached, and anything
short of fully specifying an appropriate thesaurus code for any non-LoC
authority record will run afoul of a similar outcome as the bib-data loss
situation described in bug #983487.
We can avoid this situation in most cases by /not/ tying the "|" thesaurus
value to the LoC control set.
This commit accomplishes this goal by allowing the Control Set for a thesaurus
to be NULL, removing the Control Set for "|" and removing the Control Set
recorded for records with "|" as the thesaurus value, thereby forcing Main
Entry inspection on any use of the authority record where Control Set is
required.
Signed-off-by: Mike Rylander <mrylander at gmail.com>
Signed-off-by: Lebbeous Fogle-Weekley <lebbeous at esilibrary.com>
diff --git a/Open-ILS/src/sql/Pg/002.schema.config.sql b/Open-ILS/src/sql/Pg/002.schema.config.sql
index af78f9e..e7ee170 100644
--- a/Open-ILS/src/sql/Pg/002.schema.config.sql
+++ b/Open-ILS/src/sql/Pg/002.schema.config.sql
@@ -87,7 +87,7 @@ CREATE TRIGGER no_overlapping_deps
BEFORE INSERT OR UPDATE ON config.db_patch_dependencies
FOR EACH ROW EXECUTE PROCEDURE evergreen.array_overlap_check ('deprecates');
-INSERT INTO config.upgrade_log (version, applied_to) VALUES ('0716', :eg_version); -- mrpeters/dyrcona
+INSERT INTO config.upgrade_log (version, applied_to) VALUES ('0717', :eg_version); -- eeevil/senator
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 4f8fc74..1b15025 100644
--- a/Open-ILS/src/sql/Pg/011.schema.authority.sql
+++ b/Open-ILS/src/sql/Pg/011.schema.authority.sql
@@ -47,7 +47,7 @@ CREATE TABLE authority.control_set_bib_field (
CREATE TABLE authority.thesaurus (
code TEXT PRIMARY KEY, -- MARC21 thesaurus code
- control_set INT NOT NULL REFERENCES authority.control_set (id) ON UPDATE CASCADE ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED,
+ control_set INT REFERENCES authority.control_set (id) ON UPDATE CASCADE ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED,
name TEXT NOT NULL UNIQUE, -- i18n
description TEXT -- i18n
);
diff --git a/Open-ILS/src/sql/Pg/950.data.seed-values.sql b/Open-ILS/src/sql/Pg/950.data.seed-values.sql
index b3ec916..db370c4 100644
--- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql
+++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql
@@ -10081,7 +10081,7 @@ INSERT INTO authority.thesaurus (code, name, control_set) VALUES
('s', oils_i18n_gettext('s','Sears List of Subject Headings','at','name'), 1),
('v', oils_i18n_gettext('v','Repertoire de vedettes-matiere','at','name'), 1),
('z', oils_i18n_gettext('z','Other','at','name'), 1),
- ('|', oils_i18n_gettext('|','No attempt to code','at','name'), 1);
+ ('|', oils_i18n_gettext('|','No attempt to code','at','name'), NULL);
INSERT INTO action_trigger.hook ( key, core_type, description, passive ) VALUES (
'reservation.available',
diff --git a/Open-ILS/src/sql/Pg/upgrade/0717.data.safer-control-set-defaults.sql b/Open-ILS/src/sql/Pg/upgrade/0717.data.safer-control-set-defaults.sql
new file mode 100644
index 0000000..85bda89
--- /dev/null
+++ b/Open-ILS/src/sql/Pg/upgrade/0717.data.safer-control-set-defaults.sql
@@ -0,0 +1,14 @@
+-- Evergreen DB patch 0717.data.safer-control-set-defaults.sql
+
+BEGIN;
+
+SELECT evergreen.upgrade_deps_block_check('0717', :eg_version);
+
+-- Allow un-mapped thesauri
+ALTER TABLE authority.thesaurus ALTER COLUMN control_set DROP NOT NULL;
+
+-- Don't tie "No attempt to code" to LoC
+UPDATE authority.thesaurus SET control_set = NULL WHERE code = '|';
+UPDATE authority.record_entry SET control_set = NULL WHERE id IN (SELECT record FROM authority.rec_descriptor WHERE thesaurus = '|');
+
+COMMIT;
diff --git a/Open-ILS/src/sql/Pg/version-upgrade/2.1-2.2-upgrade-db.sql b/Open-ILS/src/sql/Pg/version-upgrade/2.1-2.2-upgrade-db.sql
index 27f0fe1..a16a0cc 100644
--- a/Open-ILS/src/sql/Pg/version-upgrade/2.1-2.2-upgrade-db.sql
+++ b/Open-ILS/src/sql/Pg/version-upgrade/2.1-2.2-upgrade-db.sql
@@ -12424,6 +12424,19 @@ SELECT evergreen.upgrade_deps_block_check('0716', :eg_version);
SELECT SETVAL('config.coded_value_map_id_seq'::TEXT, (SELECT max(id) FROM config.coded_value_map));
+
+-- Evergreen DB patch 0717.data.safer-control-set-defaults.sql
+
+SELECT evergreen.upgrade_deps_block_check('0717', :eg_version);
+
+-- Allow un-mapped thesauri
+ALTER TABLE authority.thesaurus ALTER COLUMN control_set DROP NOT NULL;
+
+-- Don't tie "No attempt to code" to LoC
+UPDATE authority.thesaurus SET control_set = NULL WHERE code = '|';
+UPDATE authority.record_entry SET control_set = NULL WHERE id IN (SELECT record FROM authority.rec_descriptor WHERE thesaurus = '|');
+
+
COMMIT;
\qecho ************************************************************************
diff --git a/Open-ILS/web/js/ui/default/cat/authority/list.js b/Open-ILS/web/js/ui/default/cat/authority/list.js
index 7486427..1d1e4c4 100644
--- a/Open-ILS/web/js/ui/default/cat/authority/list.js
+++ b/Open-ILS/web/js/ui/default/cat/authority/list.js
@@ -29,7 +29,15 @@ function fetch_control_set(thesaurus) {
"at", thesaurus,
{"flesh": 1, "flesh_fields": {"at": ["control_set"]}}
);
- _acs_cache_by_at[thesaurus] = at.control_set();
+ var cs;
+ if (at.control_set()) {
+ cs = at.control_set();
+ } else {
+ cs = new fieldmapper.acs();
+ cs.name("None"); // XXX i18n
+
+ }
+ _acs_cache_by_at[thesaurus] = cs;
}
return _acs_cache_by_at[thesaurus];
}
-----------------------------------------------------------------------
Summary of changes:
Open-ILS/src/sql/Pg/002.schema.config.sql | 2 +-
Open-ILS/src/sql/Pg/011.schema.authority.sql | 2 +-
Open-ILS/src/sql/Pg/950.data.seed-values.sql | 2 +-
.../0717.data.safer-control-set-defaults.sql | 14 ++++++++++++++
.../sql/Pg/version-upgrade/2.1-2.2-upgrade-db.sql | 13 +++++++++++++
Open-ILS/web/js/ui/default/cat/authority/list.js | 10 +++++++++-
6 files changed, 39 insertions(+), 4 deletions(-)
create mode 100644 Open-ILS/src/sql/Pg/upgrade/0717.data.safer-control-set-defaults.sql
hooks/post-receive
--
Evergreen ILS
More information about the open-ils-commits
mailing list