[Bug 10380] New: output_pref should use a hashref for parameters
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10380 Bug ID: 10380 Summary: output_pref should use a hashref for parameters Classification: Unclassified Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Circulation Assignee: koha-bugs@lists.koha-community.org Reporter: jonathan.druart@biblibre.com CC: gmcharlt@gmail.com, kyle.m.hall@gmail.com Koha::DateUtils::output_pref takes 4 parameters and the last one is a boolean, so some calls are: output_pref($dt, undef, undef, 1) Which is not readable. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10380 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED Assignee|koha-bugs@lists.koha-commun |jonathan.druart@biblibre.co |ity.org |m -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10380 --- Comment #1 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 18517 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=18517&action=edit Bug 10380: Change prototype for output_pref routine Koha::DateUtils::output_pref takes 4 parameters and the last one is a boolean, so some calls are: output_pref($dt, undef, undef, 1) This patch changes it prototype to output_pref({ dt => $dt, dateformat => $dateformat, timeformat => $timeformat, dateonly => $boolean }); an alternative is to call the output_pref routine with a datetime object, without using an hashref: output_pref($dt); Test plan: Go on some page where dates are displayed (circulation, laterorder, member page, etc.). Launch the unit tests file t/DateUtils.t. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10380 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10380 Srdjan Jankovic <srdjan@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #18517|0 |1 is obsolete| | --- Comment #2 from Srdjan Jankovic <srdjan@catalyst.net.nz> --- Created attachment 18597 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=18597&action=edit [SIGNED-OFF] Bug 10380: Change prototype for output_pref routine Koha::DateUtils::output_pref takes 4 parameters and the last one is a boolean, so some calls are: output_pref($dt, undef, undef, 1) This patch changes it prototype to output_pref({ dt => $dt, dateformat => $dateformat, timeformat => $timeformat, dateonly => $boolean }); an alternative is to call the output_pref routine with a datetime object, without using an hashref: output_pref($dt); Signed-off-by: Srdjan <srdjan@catalyst.net.nz> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10380 Srdjan Jankovic <srdjan@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off CC| |srdjan@catalyst.net.nz -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10380 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10380 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #18597|0 |1 is obsolete| | --- Comment #3 from Kyle M Hall <kyle@bywatersolutions.com> --- Created attachment 19188 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=19188&action=edit Bug 10380: Change prototype for output_pref routine Koha::DateUtils::output_pref takes 4 parameters and the last one is a boolean, so some calls are: output_pref($dt, undef, undef, 1) This patch changes it prototype to output_pref({ dt => $dt, dateformat => $dateformat, timeformat => $timeformat, dateonly => $boolean }); an alternative is to call the output_pref routine with a datetime object, without using an hashref: output_pref($dt); Signed-off-by: Srdjan <srdjan@catalyst.net.nz> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10380 --- Comment #4 from Galen Charlton <gmcharlt@gmail.com> --- (In reply to comment #1)
This patch changes it prototype to output_pref({ dt => $dt,
If we switch to named parameters, we may as well avoid over-abbreviating. Would there be any objection to a followup that renames 'dt' to 'date'? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10380 Galen Charlton <gmcharlt@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |In Discussion --- Comment #5 from Galen Charlton <gmcharlt@gmail.com> --- Setting to "In discussion" pending the patch submitter answering the question I posed in comment 4. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10380 --- Comment #6 from Jonathan Druart <jonathan.druart@biblibre.com> --- (In reply to Galen Charlton from comment #5)
Setting to "In discussion" pending the patch submitter answering the question I posed in comment 4.
Oops sorry Galen, I did not see it! dt is an abbreviation for datetime, not date. So I don't think "date" is an appropriate name. However we could choose "datetime" instead. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10380 --- Comment #7 from Jonathan Druart <jonathan.druart@biblibre.com> --- Galen, should I switch this report to 'Passed QA'? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10380 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|In Discussion |Passed QA -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10380 --- Comment #8 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 20906 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=20906&action=edit Bug 10380: Followup Change prototype for output_pref routine Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10380 Galen Charlton <gmcharlt@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |rel_3_14_candidate -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10380 Galen Charlton <gmcharlt@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master --- Comment #9 from Galen Charlton <gmcharlt@gmail.com> --- Pushed to master, along with follow-ups to update a couple new calls to output_pref() and to improve the POD. Thanks, Jonathan! -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org