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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
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();