[Bug 7447] New: Allow to specify a date in overdue_notice.pl
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7447 Bug #: 7447 Summary: Allow to specify a date in overdue_notice.pl Classification: Unclassified Change sponsored?: --- Product: Koha Version: master Platform: All OS/Version: All Status: ASSIGNED Severity: enhancement Priority: P5 - low Component: Command-line Utilities AssignedTo: paul.poulain@biblibre.com ReportedBy: paul.poulain@biblibre.com QAContact: ian.walls@bywatersolutions.com -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7447 --- Comment #1 from Paul Poulain <paul.poulain@biblibre.com> 2012-01-16 16:19:39 UTC --- Created attachment 7175 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=7175 Bug 7447 allow to specify a date in overdue_notice.pl This patch add a new parameter to overdue_notices.pl, that is a date. If you add --date=YYYY-MM-DD when running overdue_notices, it will generate overdues as if you were on date provided that's usefull if you want to relaunch an overdue calculation that has failed, of after changing your circ rules -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7447 Paul Poulain <paul.poulain@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7447 Ian Walls <koha.sekjal@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA --- Comment #2 from Ian Walls <koha.sekjal@gmail.com> 2012-02-07 15:17:48 UTC --- This patch doesn't do any kind of format-checking on the 'date' param, and then loads the variable directly into the SQL. This could cause the query to fail (at best), return completely different values than intended, or destroy entire tables (at very worst). The date variable should be parameterized for the sth->execute(), and should be rigourously checked for proper date formatting. If the incoming value is not a correct date, either warn and use NOW(), or abort the script. -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7447 Paul Poulain <paul.poulain@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff --- Comment #3 from Paul Poulain <paul.poulain@biblibre.com> 2012-02-13 14:01:37 UTC --- (In reply to comment #2)
This patch doesn't do any kind of format-checking on the 'date' param, and then loads the variable directly into the SQL. This could cause the query to fail (at best), return completely different values than intended, or destroy entire tables (at very worst).
I disagree, the following line quote & make the query safe: + $date=$dbh->quote($date); It's needed, as, if there is no $date passed, then the date must be compared to NOW(), which is mad on the else: + $date="NOW()";
The date variable should be parameterized for the sth->execute(), and should be rigourously checked for proper date formatting. If the incoming value is not a correct date, either warn and use NOW(), or abort the script.
We don't do any format checking in most of the scripts, this script does not differ from others. If you think we must enforce our coding guidelines, and it's another topic (and I tend to agree with it), that should be discussed outside from this patch. Switching back to "needs signoff" -- Configure bugmail: http://bugs.koha-community.org/bugzilla3/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7447 Kyle M Hall <kyle.m.hall@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #7175|0 |1 is obsolete| | --- Comment #4 from Kyle M Hall <kyle.m.hall@gmail.com> --- Created attachment 9995 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=9995&action=edit [SIGNED-OFF] Bug 7447 allow to specify a date in overdue_notice.pl This patch add a new parameter to overdue_notices.pl, that is a date. If you add --date=YYYY-MM-DD when running overdue_notices, it will generate overdues as if you were on date provided that's usefull if you want to relaunch an overdue calculation that has failed, of after changing your circ rules 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=7447 Kyle M Hall <kyle.m.hall@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off CC| |kyle.m.hall@gmail.com -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7447 Ian Walls <koha.sekjal@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA --- Comment #5 from Ian Walls <koha.sekjal@gmail.com> --- $dbh->quote takes care of the cleanliness, so my original objection is withdrawn. Marking Passed QA. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7447 Paul Poulain <paul.poulain@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master Version|master |rel_3_10 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7447 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@biblibre.co | |m --- Comment #6 from Jonathan Druart <jonathan.druart@biblibre.com> --- This patch introduces a bug, see Bug 8607 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7447 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |11120 -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org