Bug 17922 - Default value substitution for month and day should be fixed length
Summary: Default value substitution for month and day should be fixed length
Status: Pushed to Stable
Alias: None
Product: Koha
Classification: Unclassified
Component: Cataloging (show other bugs)
Version: master
Hardware: All All
: P5 - low major (vote)
Assignee: Julian Maurice
QA Contact: Testopia
URL:
Whiteboard:
Keywords:
: 18272 (view as bug list)
Depends on: 7045
Blocks:
  Show dependency treegraph
 
Reported: 2017-01-17 14:26 UTC by Sophie MEYNIEUX
Modified: 2017-03-15 15:06 UTC (History)
9 users (show)

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


Attachments
Bug 17922: Use correct number of digits when replacing date placeholders (2.08 KB, patch)
2017-01-18 10:32 UTC, Julian Maurice
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 17922: Use correct number of digits when replacing date placeholders (2.15 KB, patch)
2017-01-20 13:47 UTC, Josef Moravec
Details | Diff | Splinter Review
Bug 17922: Use correct number of digits when replacing date placeholders (2.20 KB, patch)
2017-01-26 11:54 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 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. ***