Bug 17778 - Make "Earliest Registered Date" in OAI-PMH dynamic
Summary: Make "Earliest Registered Date" in OAI-PMH dynamic
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Web services (show other bugs)
Version: master
Hardware: All All
: P5 - low minor (vote)
Assignee: Magnus Enger
QA Contact: Testopia
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 15108
  Show dependency treegraph
 
Reported: 2016-12-15 08:41 UTC by Magnus Enger
Modified: 2017-06-14 22:17 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:


Attachments
Bug 17778 - Make "Earliest Registered Date" in OAI dynamic (1.89 KB, patch)
2017-01-06 14:31 UTC, Magnus Enger
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 17778 - Make "Earliest Registered Date" in OAI dynamic (1.95 KB, patch)
2017-01-06 15:29 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 17778: Simplify fetch date (1.05 KB, patch)
2017-01-10 14:53 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 17778 - Make "Earliest Registered Date" in OAI dynamic (2.01 KB, patch)
2017-01-11 08:22 UTC, Jonathan Druart
Details | Diff | Splinter Review
Attachment to Bug 17778 - Make "Earliest Registered Date" in OAI-PMH dynamic (1.13 KB, patch)
2017-01-11 08:22 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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