From 33620ca656a97f20d3bb0e6eb94f3870bef88821 Mon Sep 17 00:00:00 2001 From: Jane Sandberg Date: Thu, 4 Mar 2021 19:28:05 -0800 Subject: [PATCH 1/1] LP1917826: Add All Videos option to the Search Format dropdown To test: 1) Make sure that you have not added an "All Videos" option or a config.coded_value_map with ID=1738 to the system you are testing on. 2) Run the upgrade script, including the reingest. 3) Open the OPAC. 4) Perform a basic search using Format="All Videos". 5) Make sure that all the videos you expect show up, and no non-videos appear in the results. 6) Try building the database from scratch, using the seed data from this branch 7) Repeat steps 3-5. Signed-off-by: Jane Sandberg Signed-off-by: Rogan Hamby Signed-off-by: Galen Charlton --- Open-ILS/src/sql/Pg/950.data.seed-values.sql | 8 +++++- .../upgrade/XXXX.all_video_search_format.sql | 26 +++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 Open-ILS/src/sql/Pg/upgrade/XXXX.all_video_search_format.sql 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 0eb34ef3b1..b92acc59e6 100644 --- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql +++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql @@ -7830,7 +7830,10 @@ INSERT INTO config.coded_value_map oils_i18n_gettext(633, 'Blu-ray', 'ccvm', 'search_label')), (1737,'search_format','preloadedaudio', oils_i18n_gettext(1737, 'Preloaded Audio', 'ccvm', 'value'), - oils_i18n_gettext(1737, 'Preloaded Audio', 'ccvm', 'search_label')); + oils_i18n_gettext(1737, 'Preloaded Audio', 'ccvm', 'search_label')), +(1738,'search_format','video', + oils_i18n_gettext(1738, 'All Videos', 'ccvm', 'value'), + oils_i18n_gettext(1738, 'All Videos', 'ccvm', 'search_label')); -- Electronic search format, not opac_visible INSERT INTO config.coded_value_map @@ -9334,6 +9337,9 @@ INSERT INTO config.composite_attr_entry_definition (coded_value, definition) VALUES (1736,'{"0":{"_attr":"item_type","_val":"i"},"1":{"_attr":"item_form","_val":"q"}}'); +--all videos +INSERT INTO config.composite_attr_entry_definition (coded_value, definition) VALUES + (1738, '{"_attr":"item_type","_val":"g"}'); -- use the definitions from the icon_format as the basis for the MR hold format definitions DO $$ diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.all_video_search_format.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.all_video_search_format.sql new file mode 100644 index 0000000000..28376367a7 --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.all_video_search_format.sql @@ -0,0 +1,26 @@ +BEGIN; + +-- SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version); + +INSERT INTO config.coded_value_map + (id, ctype, code, opac_visible, value, search_label) + SELECT 1738,'search_format','video', true, + oils_i18n_gettext(1738, 'All Videos', 'ccvm', 'value'), + oils_i18n_gettext(1738, 'All Videos', 'ccvm', 'search_label') + WHERE NOT EXISTS ( + SELECT 1 FROM config.coded_value_map WHERE id=1738 + OR value = 'All Videos' OR search_label = 'All Videos' + ); + +INSERT INTO config.composite_attr_entry_definition (coded_value, definition) VALUES + (1738, '{"_attr":"item_type","_val":"g"}'); + +COMMIT; + +\qecho +\qecho This is a record attribute reingest of your bib records. +\qecho It will take a while. +\qecho You may cancel now without losing the effect of the rest of the +\qecho upgrade script, and arrange the reingest later. +SELECT COUNT(metabib.reingest_record_attributes(id)) + FROM biblio.record_entry WHERE deleted IS FALSE; \ No newline at end of file -- 2.43.2