Bug 14950 - A date is not correctly filled in default values from batch mod [was Remove C4::Dates from tools/batchMod.pl]
Summary: A date is not correctly filled in default values from batch mod [was Remove C...
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Marc Véron
QA Contact: Testopia
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 14870
  Show dependency treegraph
 
Reported: 2015-10-04 18:09 UTC by Marc Véron
Modified: 2016-06-21 21:38 UTC (History)
4 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 14950 - Remove C4::Dates from tools/batchMod.pl (2.85 KB, patch)
2015-10-04 18:21 UTC, Marc Véron
Details | Diff | Splinter Review
Bug 14950 - Remove C4::Dates from tools/batchMod.pl (2.99 KB, patch)
2015-10-05 08:04 UTC, j.kylmala
Details | Diff | Splinter Review
Bug 14950 - Assign default value for YYYY, MM and DD (3.40 KB, patch)
2015-10-06 10:54 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 14950: Remove unused variable $today_iso (1.01 KB, patch)
2015-10-06 10:54 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 14922: Fix day formatting if < 10 (1.61 KB, patch)
2015-10-15 12: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 Marc Véron 2015-10-04 18:09:53 UTC
This patch removes C4::Dates from tools/batchMod.pl
Comment 1 Marc Véron 2015-10-04 18:21:07 UTC Comment hidden (obsolete)
Comment 2 j.kylmala 2015-10-05 06:29:02 UTC
What is the comment "FIXME: iso dates don't have commas!" about? split ',', $today_iso doesn't work? Or is the comment about that Koha uses a comma instead of -?
Comment 3 Marc Véron 2015-10-05 07:20:00 UTC
(In reply to Joonas Kylmälä from comment #2)
> What is the comment "FIXME: iso dates don't have commas!" about? split ',',
> $today_iso doesn't work? Or is the comment about that Koha uses a comma
> instead of -?

I do not really know what the author of tis comment intended. But the comment now is obsolete because the code changed to get the values to replace YYYY, MM and DD
Comment 4 j.kylmala 2015-10-05 07:45:53 UTC
(In reply to Marc Véron from comment #3)
> (In reply to Joonas Kylmälä from comment #2)
> > What is the comment "FIXME: iso dates don't have commas!" about? split ',',
> > $today_iso doesn't work? Or is the comment about that Koha uses a comma
> > instead of -?
> 
> I do not really know what the author of tis comment intended. But the
> comment now is obsolete because the code changed to get the values to
> replace YYYY, MM and DD

Yes, it's obsolete now. I was reading the git diff in the wrong way and thought that you put the comment there ! :)
Comment 5 j.kylmala 2015-10-05 08:04:12 UTC Comment hidden (obsolete)
Comment 6 Jonathan Druart 2015-10-06 10:54:43 UTC
Created attachment 43155 [details] [review]
Bug 14950 - Assign default value for YYYY, MM and DD

[was Remove C4::Dates from tools/batchMod.pl]

This patch replace the YYYY, MM and DD if defined in the default values.

This patch also removes C4::Dates from tools/batchMod.pl

To test:

- In MARC bibliographic Default framework, define a default value
  for one of the in Tag 952 Subfield struture, e.g. for
  subfield x Non-public note. You can define it under
  'Advancde constraints'. Define the value similar to the following:
  Year:YYYY Month:MM Day:DD
- Got to Home > Tools > Batch item modification
- Enter one ore more barcodes you want to modify
- Check checkbox 'Populate fields with defautl values from defautl framework
- Click 'Continue'
- Verify on the follwing screen that the field in Edit form is populated
  as appropriate (in our example 'x - Non public note')
- Click 'Save'
- Verify that the items are updated as appropriate

Signed-off-by: Joonas Kylmälä <j.kylmala@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Amended commit message: This is a bug fix and can be backported. The
YYYY, MM and DD were not replaced correctly before this patch.
I got Year:2015-10-06 Month: Day:
now I correctly get Year: 2015 Month: 10 Day: 06
Comment 7 Jonathan Druart 2015-10-06 10:54:48 UTC
Created attachment 43156 [details] [review]
Bug 14950: Remove unused variable $today_iso

This variable is not used anymore in the template (and has never been
used...).

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 8 Tomás Cohen Arazi 2015-10-06 14:06:53 UTC
Patches pushed to master.

Thanks Marc!
Comment 9 Jonathan Druart 2015-10-15 12:54:21 UTC
Created attachment 43434 [details] [review]
Bug 14922: Fix day formatting if < 10

$dt->day return a single digit if < 10, we want to display it on 2
digits

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 10 Jonathan Druart 2015-10-15 12:55:33 UTC
Tomas, could you please consider this last patch for master please?
On bug 14922, I caught this problem and would prefer to fix it here as the patches could be backported on stable branches (14922 is an enh).
Comment 11 Tomás Cohen Arazi 2015-10-15 14:42:12 UTC
Good catch Jonathan!

Patch pushed to master, with correctect subject.
Comment 12 Chris Cormack 2015-10-23 13:31:38 UTC
Pushed to 3.20.x will be in 3.20.5