LP 1904737: Expand copy statuses for the pull list Evergreen limits copies on the pull list to those with hard coded status values of 0 or 7. This commit expands the range of copies available to fill holds to any copy whose status has both the holdable and is_available fields set to true. This modification affords sites more control over what copy statuses can fill holds, including custom ones. The hold targeter and database functions that calculate counts of copies available to fill holds are also modified to use the new logic. In order to maintain timely performance, new indexes are created on the asset copy and serial unit table circ_lib columns the deleted column is false. The previous indexes on these columns where the copy status is 0 or 7 are dropped. Queries that used the old indexes are modified to use the new indexes. A database regression tests are added to check that the new indexes exist and the the old indexes do not. Live tests are added to the live_t/20-hold-targeter.t test suite to exercise the new functionality and verify that it works as expected for the hold targeter and the asset.staff_ou_metarecord_copy_count database function. (If someone could figure out a decent way to live test the pull list and the other database functions, that would be great.) On a default system, only statuses 0 and 7 match the new criteria to fill holds, so testing the pull list would amount to checking that the behavior has not changed after installation of the new code. In order to verify that the change actually works, one could add a new status or modify an existing status so that the holdable and is_available fields are true. After running the hold targeter, a different number of copies should be available to fill some holds. Different copies may appear on the pull list as a result. Signed-off-by: Jason Stephenson <jason@sigio.com> Signed-off-by: John Amundson <jamundson@cwmars.org> Signed-off-by: Jane Sandberg <js7389@princeton.edu>
Lp 1922567: Limit authority.full_rec.value indexes Limit the authority_full_rec_value_index and authority_full_rec_value_tpo_index indexes to the first 1024 characters of a field or subfield in order to avoid database errors when inserting or updating authorities with long fields. Include release note and regression test. Signed-off-by: Jason Stephenson <jason@sigio.com> Signed-off-by: Jennifer Weston <jennifer.weston@equinoxOLI.org> Signed-off-by: Galen Charlton <gmc@equinoxOLI.org>
LP#1928258: update pgTAP regression test Now that update_bib_editor is split out into a separate merge profile field, need to account for that in the regression test for 1447746. Signed-off-by: Galen Charlton <gmc@equinoxOLI.org>
Lp 1730726: Fix a number of PgTap tests for PostgreSQL 10. A number of tests disabled output via "\set ECHO". In PostgreSQL 10, the lack of a value in \set is an error. We change these lines to "\set ECHO none". Signed-off-by: Jason Stephenson <jason@sigio.com> Signed-off-by: Ben Shum <ben@evergreener.net>
LP1773452: Repeating copy alerts Without considering the checkin_time on the most recent circ for an item, checking in a lost, claims returned, or claims never checked out item would cause copy alerts on checkin repeatedly until it was checked out again. Staff may be confused by this thinking that there is a continuing problem with the item until the alerts go away. Signed-off-by: Jason Boyer <jboyer@library.in.gov> Signed-off-by: Jennifer Pringle <jennifer.pringle@bc.libraries.coop> Signed-off-by: Mike Rylander <mrylander@gmail.com>
LP#1714594: fix lp1629108_metarecord_constituent_result_reroute.pg This patch accounts for the fact that the IDs returned in source_list do not have a set order. It also no longer recreates unapi.mmr_mra() within the test case, meaning that it can now serve as a true regression test. Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
LP#1378829 Fix long overdue override permission Fix override permission used when checking in a copy that is "long overdue". The existing permission was incorrectly created with a code of COPY_STATUS_LONGOVERDUE.override, while the event thrown requires a permission with a code of COPY_STATUS_LONG_OVERDUE.override This commit updates the seed data and a few references to the old/incorrect permission in documentation, and also includes an upgrade script designed to accommodate the various likely ways in which sites may have already locally addressed this issue. A simple pgtap test is also included. Signed-off-by: Jeff Godin <jgodin@tadl.org> Signed-off-by: Jason Stephenson <jason@sigio.com>
LP#1442276 pgTAP test for oils_xslt_process In moving from the deprecated XML::LibXSLT::output_string() to output_as_chars(), add a regression test to ensure that we do not suffer from corrputed encoding output in the future. We test both the case where an output encoding has been explicitly declared, as well as the case where an output encoding has not been explicitly declared. It was this subtle difference that was causing the problem with output_string(). Signed-off-by: Dan Scott <dan@coffeecode.net> Signed-off-by: Kathy Lussier <klussier@masslnc.org>
LP#1665626: Update metarecord_constituent_result_reroute.pg test Updating metarecord PgTAP test so that it points to an existing metarecord group in the test data. Signed-off-by: Kathy Lussier <klussier@masslnc.org> Signed-off-by: Ben Shum <ben@evergreener.net>
LP1629108 metarecord_constituent_result_reroute This patch will route the metasearch logic through the "standard" search logic in order to leverage the heavy use of filters and other features. A column is introduced to unapi.mmr_mr to include the constituent bibs in the return. A tweak was required in the template toolkit code to take advantage of the new payload. This enables TT to decide which icons should be displayed when search results are filtered. Signed-off-by: blake <blake@mobiusconsortium.org> Signed-off-by: Kathy Lussier <klussier@masslnc.org>
LP#1549505: Remove stray semicolon from PgTap test The semicolon was causing failures in the test. Signed-off-by: Kathy Lussier <klussier@masslnc.org> Signed-off-by: Galen Charlton <gmc@esilibrary.com> Signed-off-by: Kathy Lussier <klussier@masslnc.org>
LP#1549505: PGTap test to show the infrastructure is working Signed-off-by: Mike Rylander <mrylander@gmail.com> Signed-off-by: Galen Charlton <gmc@esilibrary.com> Signed-off-by: Kathy Lussier <klussier@masslnc.org>
LP#1447746: Fix lp957466_update_date_and_source regression test The new code introduced through LP1447746 adding an update_bib_source flag to Vandelay merge profiles broke a test that was verifying the bib source and edit fields were updated in Vandelay uploads. This patch fixes the test and also adds a new test to ensure the flag works as expected when set to both true and false. It also renames the test since the it's now testing the newer code rather than the previous expected behavior. Signed-off-by: Kathy Lussier <klussier@masslnc.org> Signed-off-by: Ben Shum <ben@evergreener.net>
LP#1569884: add regression test This pgTAP test verifies that if you logically delete a monograph part, you can subsequently add a new one with the same label as that of the deleted one. Signed-off-by: Galen Charlton <gmc@esilibrary.com>
LP#937789: various improvements to logical deletion of parts This patch ensures that when a monograph part is marked as deleted, that mappings between it and its copies are also removed, similar to the previous behavior of the cascade on delete. This patch also adds some pgTAP tests and ensures that unapi.bmp() and unapi.holdings_xml() get updated during upgrade. To test the fix for this bug: [1] Apply the patches. [2] Create a monograph part on a record, then delete it. Verify that it no longer shows up in the parts maintenance interface, but that a row in the biblio.monograph_parts table still exists with the deleted flag set to true. [3] Create another monograph part on the same record. [4] Create a new volume/copy and assign the part created in step 3 to it. Verify that the part shown in step 2 is *not* included in the XUL part selector. [5] Place a part-level hold. Verify that the hold request is displayed correct in both the public catalog and the staff interface. [6] Delete the part created in step 3. [7] Verify that viewing the list of the patron's holds in the XUL staff client doesn't result in any 'network errors'. Also verify that the hold request is still displayed in patron's view in the public catalog. [8] Using SQL or some other means, set the expire_time and prev_check_time of the test hold request to a couple days in the past, then run the hold targeter. Verify that the hold gets cancelled for lack of a suitable copy to fill it. Signed-off-by: Galen Charlton <gmc@esilibrary.com> Signed-off-by: Remington Steed <rjs7@calvin.edu> Signed-off-by: Ben Shum <bshum@biblio.org>
LP# 1484281 auth control config update to prevent propagated data deletion Remove subfield 'e' from authority.control_set_authority_field seed values Removed from the auth tag 100 and 110, which should apply to bib tags 100,110,600,610,700,710 Added upgrade script, and pgTAP test. How to test this patch ---------------------- [1] To test this bug you need 1 authority record and at least 1 bib record. The auth record needs to have an auth 100 or 110 tag that has a subfield $e, for example 100 $aDavis, Miles $ecomposer. (for the record, it is not good cataloging practice to have $e in the auth record, but it can happen by mistake.) The bib record needs to be have a matching bib 100 or 700 tag with the same subfield $a and $e. In addition the matching bib tag has to be linked to the authority record, i.e. the bib tag has to have a bib subfield $0 with the DB id of the authority record. [2] If you open up the authority record, in the authority MARC editor, and remove the subfield $e; the subfield $e found in the bib record tag will be removed. This is a mistake because normally bib record tags 100/110/700/710 do use subfield $e, though the subfield $e should not be used in the auth record 100/110 tags. [3] When this patch is applied, if a cataloger removes a subfield $e from an auth 100/110 tag, the deletion will not cascade to its linked bibs. Signed-off-by: Yamil Suarez <yamil@yamil.com> Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>
LP#1442796: make XPath-based record attribute definitions work Record attribue definitions that use XPath to extract their values could break ingest; this patch fixes that. Signed-off-by: Galen Charlton <gmc@esilibrary.com> Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>