Bug 39857 - OAI expanded_avs option broken
Summary: OAI expanded_avs option broken
Status: Pushed to main
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: Main
Hardware: All All
: P5 - low major
Assignee: Nick Clemens (kidclamp)
QA Contact: Tomás Cohen Arazi (tcohen)
URL:
Keywords: rel_24_11_candidate
Depends on: 31224
Blocks:
  Show dependency treegraph
 
Reported: 2025-05-07 17:57 UTC by Nick Clemens (kidclamp)
Modified: 2025-05-13 06:25 UTC (History)
1 user (show)

See Also:
GIT URL:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
25.05.00
Circulation function:


Attachments
Bug 39857: Fix expanded_avs option for OAI (1.54 KB, patch)
2025-05-07 18:03 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 39857: Fix expanded_avs option for OAI (1.59 KB, patch)
2025-05-07 19:59 UTC, Roman Dolny
Details | Diff | Splinter Review
Bug 39857: Regression tests (4.01 KB, patch)
2025-05-08 13:30 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review
Bug 39857: Fix expanded_avs option for OAI (1.91 KB, patch)
2025-05-08 13:30 UTC, Tomás Cohen Arazi (tcohen)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Clemens (kidclamp) 2025-05-07 17:57:10 UTC
Bug 31224 moved OAI to use metadata_record - when doing so the param to expand fields was incorrectly added as:

expand_coded_values => $expanded_avs,

It should be:

expand_coded_fields => $expanded_avs,
Comment 1 Nick Clemens (kidclamp) 2025-05-07 18:03:15 UTC
Created attachment 182037 [details] [review]
Bug 39857: Fix expanded_avs option for OAI

This patch correct the call to filter the record

To test:
1 - Enable OAI
2 - Set  OAI-PMH:ConfFile to '/var/lib/koha/kohadev/OAI.yaml'
3 - Edit/create the file above to have content:
format:
  marcxml:
    metadataPrefix: marcxml
    metadataNamespace: http://www.loc.gov/MARC21/slim http://www.loc.gov/standards/marcxml/schema/MARC21slim
    schema: http://www.loc.gov/MARC21/slim http://www.loc.gov/standards/marcxml/schema/MARC21slim.xsd
    include_items: 1
    expanded_avs: 1
4 - save and restart_all
5 - View some records:
    http://localhost:8080/cgi-bin/koha/oai.pl?verb=ListRecords&metadataPrefix=marcxml
6 - Note the items show coded values
7 - Apply patch
8 - Restart all
9 - Refresh and confirm items now have descriptions
Comment 2 Roman Dolny 2025-05-07 19:59:52 UTC
Created attachment 182045 [details] [review]
Bug 39857: Fix expanded_avs option for OAI

This patch correct the call to filter the record

To test:
1 - Enable OAI
2 - Set  OAI-PMH:ConfFile to '/var/lib/koha/kohadev/OAI.yaml'
3 - Edit/create the file above to have content:
format:
  marcxml:
    metadataPrefix: marcxml
    metadataNamespace: http://www.loc.gov/MARC21/slim http://www.loc.gov/standards/marcxml/schema/MARC21slim
    schema: http://www.loc.gov/MARC21/slim http://www.loc.gov/standards/marcxml/schema/MARC21slim.xsd
    include_items: 1
    expanded_avs: 1
4 - save and restart_all
5 - View some records:
    http://localhost:8080/cgi-bin/koha/oai.pl?verb=ListRecords&metadataPrefix=marcxml
6 - Note the items show coded values
7 - Apply patch
8 - Restart all
9 - Refresh and confirm items now have descriptions

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Comment 3 Tomás Cohen Arazi (tcohen) 2025-05-08 13:30:33 UTC
Created attachment 182083 [details] [review]
Bug 39857: Regression tests

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 4 Tomás Cohen Arazi (tcohen) 2025-05-08 13:30:35 UTC
Created attachment 182084 [details] [review]
Bug 39857: Fix expanded_avs option for OAI

This patch correct the call to filter the record

To test:
1 - Enable OAI
2 - Set  OAI-PMH:ConfFile to '/var/lib/koha/kohadev/OAI.yaml'
3 - Edit/create the file above to have content:
format:
  marcxml:
    metadataPrefix: marcxml
    metadataNamespace: http://www.loc.gov/MARC21/slim http://www.loc.gov/standards/marcxml/schema/MARC21slim
    schema: http://www.loc.gov/MARC21/slim http://www.loc.gov/standards/marcxml/schema/MARC21slim.xsd
    include_items: 1
    expanded_avs: 1
4 - save and restart_all
5 - View some records:
    http://localhost:8080/cgi-bin/koha/oai.pl?verb=ListRecords&metadataPrefix=marcxml
6 - Note the items show coded values
7 - Apply the regressions tests patch
8 - Run:
    $ ktd --shell
   k$ prove t/db_dependent/Koha/OAI/Server/Repository.t
=> FAIL: Tests fail!
9 - Apply this patch
10 - Restart all
11 - Refresh and confirm items now have descriptions
12 - Repeat 8
=> SUCCESS: Tests pass!

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Edit (tcohen): Amended the test plan to include the added regression
tests run
Comment 5 Katrin Fischer 2025-05-09 07:14:55 UTC
Pushed for 25.05!

Well done everyone, thank you!
Comment 6 Angela Berrett 2025-05-12 22:57:03 UTC
(In reply to Katrin Fischer from comment #5)
> Pushed for 25.05!
> 
> Well done everyone, thank you!

Any chance this can be backported to 24.11.xx? It's messing with a few other systems that talk to Koha for us.