LP#1949892: join up non-multi display entries user/gmcharlt/lp1949892_join_up_display_field
authorGalen Charlton <gmc@equinoxOLI.org>
Thu, 4 Nov 2021 19:17:11 +0000 (15:17 -0400)
committerGalen Charlton <gmc@equinoxOLI.org>
Thu, 4 Nov 2021 19:17:11 +0000 (15:17 -0400)
commite999f30a9e561661e4844638d0ed9c6acafeb0c0
tree9f4d7845e4359aa2e2db9a5e795e9bfd2d08dcca
parentc67ca10b6ee9b54ffd8868ec9e406f2e401a674b
LP#1949892: join up non-multi display entries

This patch ensures that if a display field that is
not marked as "multi" in config.display_entry_map has
an XPath expression that could result in multiple XML
nodes, that it gets joined up into just a single
display entry.

To test
-------
[1] Update the title|proper metabib display field config
    to change the format to 'marcxml' and the XPath to the following:

//marc:datafield[@tag="245"]/marc:subfield[@code="a" or @code="b" or @code="n" or @code="p" or @code="k" or @code="f" or @code="g" or @code="s"]

[2] Load or save a bib record that has at least subfields $a and $b
    in the 245.
[3] Search for the title in the Angular staff catalog. Note that only
    one of the subfields is displayed in the record summary.
[4] Apply the patch and reindex the record, then repeat step 4. This
    time, the whole title should be displayed.
[5] By querying (say) metabib.display_field, verify that display
    entries such as the ISBN that _are_ marked as multi do have
    a display entry for each ISBN.

Signed-off-by: Galen Charlton <gmc@equinoxOLI.org>
Open-ILS/src/sql/Pg/030.schema.metabib.sql
Open-ILS/src/sql/Pg/upgrade/XXXX.schema.join-up-non-multi-display-fields.sql [new file with mode: 0644]