Bug 17922

Summary: Default value substitution for month and day should be fixed length
Product: Koha Reporter: Sophie MEYNIEUX <sophie.meynieux>
Component: CatalogingAssignee: Julian Maurice <julian.maurice>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: major    
Priority: P5 - low CC: alex.arnaud, fridolin.somers, jonathan.druart, julian.maurice, katrin.fischer, kyle, m.de.rooy, mtj, ruatuki
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on: 7045    
Bug Blocks:    
Attachments: Bug 17922: Use correct number of digits when replacing date placeholders
[SIGNED-OFF] Bug 17922: Use correct number of digits when replacing date placeholders
Bug 17922: Use correct number of digits when replacing date placeholders

Description Sophie MEYNIEUX 2017-01-17 14:26:45 UTC
Placeholders <<MM>> and <<DD>> used for default values in cataloguing frameworks should be replaced by a 2 digit number. This is mandatory for fixed length fields.
Comment 1 Julian Maurice 2017-01-18 10:32:23 UTC
Created attachment 59151 [details] [review]
Bug 17922: Use correct number of digits when replacing date placeholders

This patch also fixes a typo ("<<MM><" should be "<<MM>>")
Comment 2 Julian Maurice 2017-01-18 10:37:35 UTC
Test plan:

1. In your MARC framework, set a default value of "<<YYYY>><<MM>><<DD>>" for a biblio subfield and an item subfield.
2. Create a new biblio record then check that the value of subfield is 20170118 and not 2017118 (value can change obviously)
3. Create a new item record then check that the default value is ok.
Comment 3 Julian Maurice 2017-01-18 10:40:18 UTC
Increasing severity as this can cause software errors for fixed length fields:

Unsupported UNIMARC character encoding [05] for XML output for UNIMARC; 100$a -> 2017118d        u||y0frey5050    ba at /usr/share/perl5/MARC/File/XML.pm line 568.
Comment 4 Josef Moravec 2017-01-20 13:47:51 UTC
Created attachment 59373 [details] [review]
[SIGNED-OFF] Bug 17922: Use correct number of digits when replacing date placeholders

This patch also fixes a typo ("<<MM><" should be "<<MM>>")

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 5 Jonathan Druart 2017-01-26 11:54:12 UTC
Created attachment 59577 [details] [review]
Bug 17922: Use correct number of digits when replacing date placeholders

This patch also fixes a typo ("<<MM><" should be "<<MM>>")

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

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Comment 6 Jonathan Druart 2017-01-26 11:55:46 UTC
Ouch, my bad.
Would be great to get this stuff moved to a module and provide tests.

But this patch definitely fixes issues and should be pushed and backported ASAP.
Comment 7 Kyle M Hall 2017-02-07 17:52:54 UTC
Pushed to master for 17.05, thanks Julian!
Comment 8 Katrin Fischer 2017-02-07 21:18:53 UTC
This patch has been pushed to 16.11.x and will be in 16.11.04.
Comment 9 Julian Maurice 2017-02-09 09:36:18 UTC
Pushed to 3.22.x for 3.22.17
Comment 10 Mason James 2017-02-22 23:09:48 UTC
Pushed to 16.05.x, for 16.05.10 release
Comment 11 Alex Arnaud 2017-03-15 15:06:30 UTC
*** Bug 18272 has been marked as a duplicate of this bug. ***