Bug 17744

Summary: OAI: oai_dc has no element named dcCollection
Product: Koha Reporter: Julian Maurice <julian.maurice>
Component: Web servicesAssignee: Julian Maurice <julian.maurice>
Status: CLOSED FIXED QA Contact: Marcel de Rooy <m.de.rooy>
Severity: major    
Priority: P5 - low CC: kyle, m.de.rooy, mtj
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Bug Depends on: 12252    
Bug Blocks:    
Attachments: Bug 17744: Remove the oai_dc:dcCollection wrapper in OAI responses
[SIGNED-OFF] Bug 17744: Remove the oai_dc:dcCollection wrapper in OAI responses
Bug 17744: Remove the oai_dc:dcCollection wrapper in OAI responses
[3.22.x] Bug 17744: Remove the oai_dc:dcCollection wrapper in OAI responses

Description Julian Maurice 2016-12-08 09:12:59 UTC
OAI GetRecord and ListRecords, when called with metadataPrefix=oai_dc, return something like this:

  <metadata>
    <oai_dc:dcCollection xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/oai_dc/ http://www.openarchives.org/OAI/2.0/oai_dc.xsd">
      <oai_dc:dc>
        <oai_dc:title>...</oai_dc:title>
        ...
      </oai_dc:dc>
    </oai_dc:dcCollection>
  </metadata>

According to http://www.openarchives.org/OAI/2.0/oai_dc.xsd there is no dcCollection element in oai_dc. Moreover the OAI Repository Explorer (http://re.cs.uct.ac.za/) returns errors about this:

  [Error] re.ZeDK9z:3:756: cvc-complex-type.2.4.a: Invalid content was found starting with element 'oai_dc:dcCollection'. One of '{"http://www.openarchives.org/OAI/2.0/oai_dc/":dc}' is expected.
  
Some other OAI harvesting tools also fail to parse the response successfully.

I found a discussion about this: https://lists.katipo.co.nz/public/koha/2016-April/045130.html
There is a patch provided (https://lists.katipo.co.nz/public/koha/2016-April/045283.html) but no bug was opened.

This is a regression caused by bug 12252, and it affects all versions since 3.22
Comment 1 Julian Maurice 2016-12-08 09:15:47 UTC
Created attachment 58036 [details] [review]
Bug 17744: Remove the oai_dc:dcCollection wrapper in OAI responses
Comment 2 Julian Maurice 2016-12-08 09:19:22 UTC
Test plan:

1. Empty system preference OAI-PMH:ConfFile
2. Go to http://opac.tld/cgi-bin/koha/oai.pl?verb=ListRecords&metadataPrefix=oai_dc
3. Confirm you have oai_dc:dcCollection element in <metadata>
4. Apply patch
5. Repeat 2
6. Confirm you don't have oai_dc:dcCollection element in <metadata>
Comment 3 Josef Moravec 2016-12-14 22:27:46 UTC
Created attachment 58192 [details] [review]
[SIGNED-OFF] Bug 17744: Remove the oai_dc:dcCollection wrapper in OAI responses

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 4 Marcel de Rooy 2016-12-15 14:34:30 UTC
Created attachment 58204 [details] [review]
Bug 17744: Remove the oai_dc:dcCollection wrapper in OAI responses

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 5 Kyle M Hall (khall) 2016-12-16 11:05:26 UTC
Pushed to master for 17.05, thanks Julian!
Comment 6 Katrin Fischer 2016-12-18 18:43:23 UTC
This patch has been pushed to 16.11.x, will be in 16.11.01.
Comment 7 Julian Maurice 2017-01-02 10:57:24 UTC
Created attachment 58553 [details] [review]
[3.22.x] Bug 17744: Remove the oai_dc:dcCollection wrapper in OAI responses
Comment 8 Julian Maurice 2017-01-02 10:57:51 UTC
Pushed to 3.22.x for 3.22.14
Comment 9 Mason James 2017-01-29 11:47:55 UTC
Pushed to 16.05.x, for 16.05.07 release