Bugzilla – Attachment 109151 Details for
Bug 21066
Replace opac_news.timestamp by published_on and add updated_on as timestamp
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21066: Resolve SQL errors in strict mode
Bug-21066-Resolve-SQL-errors-in-strict-mode.patch (text/plain), 2.11 KB, created by
Owen Leonard
on 2020-08-26 12:08:32 UTC
(
hide
)
Description:
Bug 21066: Resolve SQL errors in strict mode
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2020-08-26 12:08:32 UTC
Size:
2.11 KB
patch
obsolete
>From 9cd593d8ab1e19de8acadbc1fa6886635ae6d47e Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Mon, 3 Aug 2020 13:41:11 +0000 >Subject: [PATCH] Bug 21066: Resolve SQL errors in strict mode > >DBD::mysql::st execute failed: Incorrect integer value: '' for column `koha_master`.`opac_news`.`number` at row 1 [for Statement "INSERT INTO opac_news ( content,number,lang,title,branchcode,borrowernumber,expirationdate,publicationdate ) VALUES ( ?,?,?,?,?,?,?,? )" with ParamValues: 0="test", 1="", 2="", 3="test", 4=undef, 5="51", 6='2020-08-11', 7='2020-08-04'] at /usr/share/koha/C4/NewsChannels.pm line 68. >DBD::mysql::st execute failed: Incorrect integer value: 'a' for column `koha_master`.`opac_news`.`number` at row 1 [for Statement "UPDATE opac_news SET lang = ?,publicationdate = ?,expirationdate = ?,number = ?,content = ?,branchcode = ?,title = ? WHERE idnew = ?;" with ParamValues: 0="", 1='2020-08-03', 2=undef, 3="a", 4="test", 5=undef, 6="test", 7="9"] at /usr/share/koha/C4/NewsChannels.pm line 107. > >Test plan: >Do not apply this patch. >Enable strict mode in koha-conf. >Add new record in tools/news leaving 'Appear in position' blank. >The record is not added; you have a warn in your plack-error log. >Apply patch and try again. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> >--- > C4/NewsChannels.pm | 2 ++ > 1 file changed, 2 insertions(+) > >diff --git a/C4/NewsChannels.pm b/C4/NewsChannels.pm >index bfcbfc6afe..f39113cd89 100644 >--- a/C4/NewsChannels.pm >+++ b/C4/NewsChannels.pm >@@ -58,6 +58,7 @@ sub add_opac_new { > my $retval = 0; > > if ($href_entry) { >+ $href_entry->{number} = 0 if $href_entry->{number} !~ /^\d+$/; > my @fields = keys %{$href_entry}; > my @values = values %{$href_entry}; > my $field_string = join ',', @fields; >@@ -85,6 +86,7 @@ sub upd_opac_new { > my $retval = 0; > > if ($href_entry) { >+ $href_entry->{number} = 0 if $href_entry->{number} !~ /^\d+$/; > # take the keys of hash entry and make a list, but... > my @fields = keys %{$href_entry}; > my @values; >-- >2.11.0
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 21066
:
77037
|
77038
|
77039
|
107769
|
107770
|
107771
|
107772
|
107773
|
107774
|
107775
|
107776
|
109148
|
109149
|
109150
|
109151
|
109152
|
109153
|
109154
|
109192
|
109193
|
109194
|
109195
|
109196
|
109197
|
109198
|
109199
|
109354
|
109514
|
109515