LP#1949892: join up non-multi display entries (3.7.x version) user/gmcharlt/lp1949892_join_up_display_field-3.7
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:23:47 +0000 (15:23 -0400)
commite364709672bae53477a71d7aa93733cf8a0bb534
tree0001ab773e3fe3371a18fd8baa9b18bb05bccbc7
parentf2081ba7fcf2b8c228ded32129b002accb70017d
LP#1949892: join up non-multi display entries (3.7.x version)

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]