Bugzilla – Attachment 58417 Details for
Bug 14637
Add patron category fails with MySQL 5.6.26
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14637: Fix add patron category under MySQL 5.7
Bug-14637-Fix-add-patron-category-under-MySQL-57.patch (text/plain), 1.71 KB, created by
Kyle M Hall (khall)
on 2016-12-23 13:36:34 UTC
(
hide
)
Description:
Bug 14637: Fix add patron category under MySQL 5.7
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2016-12-23 13:36:34 UTC
Size:
1.71 KB
patch
obsolete
>From 5e1aab0ee6907b77584534c2cca997adec184b1d Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 6 Sep 2016 10:40:46 +0100 >Subject: [PATCH] Bug 14637: Fix add patron category under MySQL 5.7 > >If no dateofbirthrequired or upperagelimit is set on the interface, the >->store method will receive an empty string defined for these values. >For INT field, we must explicitely set these empty value to undef >instead to avoid MySQL 5.7 (and strict mode) to raise: > DBD::mysql::st execute failed: Incorrect integer value: ' for column >'dateofbirthrequired'' > >Test plan: >Using MySQL 5.7 (and/or sql_mode=STRICT_TRANS_TABLES) >Create a patron category without specifying upperagelimit or >dateofbirthrequired > >Signed-off-by: Josef Moravec <josef.moravec@gmail.com> > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > Koha/Patron/Category.pm | 21 +++++++++++++++++++++ > 1 file changed, 21 insertions(+) > >diff --git a/Koha/Patron/Category.pm b/Koha/Patron/Category.pm >index b1244d5..5a456b7 100644 >--- a/Koha/Patron/Category.pm >+++ b/Koha/Patron/Category.pm >@@ -50,6 +50,27 @@ sub effective_BlockExpiredPatronOpacActions { > return $self->BlockExpiredPatronOpacActions > } > >+=head3 store >+ >+=cut >+ >+sub store { >+ my ($self) = @_; >+ >+ $self->dateofbirthrequired(undef) >+ if not defined $self->dateofbirthrequired >+ or $self->dateofbirthrequired eq ''; >+ >+ $self->upperagelimit(undef) >+ if not defined $self->upperagelimit >+ or $self->upperagelimit eq ''; >+ >+ $self->checkprevcheckout('inherit') >+ unless defined $self->checkprevcheckout; >+ >+ return $self->SUPER::store; >+} >+ > =head3 default_messaging > > my $messaging = $category->default_messaging(); >-- >2.1.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 14637
:
55232
|
55233
|
56674
|
56675
|
56676
|
56677
|
58416
| 58417 |
58418