Bug 17778

Summary: Make "Earliest Registered Date" in OAI-PMH dynamic
Product: Koha Reporter: Magnus Enger <magnus>
Component: Web servicesAssignee: Magnus Enger <magnus>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: minor    
Priority: P5 - low CC: jonathan.druart, katrin.fischer, kyle, mtj
Version: master   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Text to go in the release notes:
Version(s) released in:
Bug Depends on:    
Bug Blocks: 15108    
Attachments: Bug 17778 - Make "Earliest Registered Date" in OAI dynamic
[SIGNED-OFF] Bug 17778 - Make "Earliest Registered Date" in OAI dynamic
Bug 17778: Simplify fetch date
Bug 17778 - Make "Earliest Registered Date" in OAI dynamic
Attachment to Bug 17778 - Make "Earliest Registered Date" in OAI-PMH dynamic

Description Magnus Enger 2016-12-15 08:41:31 UTC
The value of earliestDatestamp is hardcoded on line 37 of Koha/OAI/Server/Identify.pm:

         earliestDatestamp   => '0001-01-01',

http://git.koha-community.org/gitweb/?p=koha.git;a=blob;f=Koha/OAI/Server/Identify.pm;h=3ab21889568ae41a216f717eddd6f15cc2c48b44;hb=HEAD#l37

It should not be too hard to replace this with the output of something like this:

SELECT DATE(MIN(timestamp)) FROM biblio;
Comment 1 Magnus Enger 2017-01-06 14:31:26 UTC
Created attachment 58647 [details] [review]
Bug 17778 - Make "Earliest Registered Date" in OAI dynamic

This was hardcoded to 0001-01-01.

To test:
- Make sure you have a couple of records, with different timestamps
- Enable OAI-PMH
- Check http://localhost:2201/cgi-bin/koha/oai.pl?verb=Identify
  and verify that "Earliest Registered Date" is 0001-01-01
- Apply the patch
- Re-check the "Earliest Registered Date" and verify that it is now
  the lowest timestamp in your biblio table
- Manipulate the timestamps and verify that "Earliest Registered Date"
  changes accordingly
- Sign off!
Comment 2 Owen Leonard 2017-01-06 15:29:19 UTC
Created attachment 58648 [details] [review]
[SIGNED-OFF] Bug 17778 - Make "Earliest Registered Date" in OAI dynamic

This was hardcoded to 0001-01-01.

To test:
- Make sure you have a couple of records, with different timestamps
- Enable OAI-PMH
- Check http://localhost:2201/cgi-bin/koha/oai.pl?verb=Identify
  and verify that "Earliest Registered Date" is 0001-01-01
- Apply the patch
- Re-check the "Earliest Registered Date" and verify that it is now
  the lowest timestamp in your biblio table
- Manipulate the timestamps and verify that "Earliest Registered Date"
  changes accordingly
- Sign off!

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 3 Jonathan Druart 2017-01-10 14:53:33 UTC
Created attachment 58758 [details] [review]
Bug 17778: Simplify fetch date
Comment 4 Jonathan Druart 2017-01-11 08:22:18 UTC
Created attachment 58796 [details] [review]
Bug 17778 - Make "Earliest Registered Date" in OAI dynamic

This was hardcoded to 0001-01-01.

To test:
- Make sure you have a couple of records, with different timestamps
- Enable OAI-PMH
- Check http://localhost:2201/cgi-bin/koha/oai.pl?verb=Identify
  and verify that "Earliest Registered Date" is 0001-01-01
- Apply the patch
- Re-check the "Earliest Registered Date" and verify that it is now
  the lowest timestamp in your biblio table
- Manipulate the timestamps and verify that "Earliest Registered Date"
  changes accordingly
- Sign off!

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 5 Jonathan Druart 2017-01-11 08:22:25 UTC
Created attachment 58797 [details] [review]
Attachment to Bug 17778 - Make "Earliest Registered Date" in OAI-PMH dynamic

Bug 17778: Simplify fetch date

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 6 Kyle M Hall 2017-01-13 11:33:59 UTC
Pushed to master for 17.05, thanks Magnus, Jonathan!
Comment 7 Katrin Fischer 2017-01-15 17:06:21 UTC
These patches have been pushed to 16.11.x and will be in 16.11.02.
.
Comment 8 Mason James 2017-01-27 03:03:15 UTC
Pushed to 16.05.x, for 16.05.08 release