Bugzilla – Attachment 95402 Details for
Bug 23825
Object.t is failing - Exception not caught
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23825: Koha/Object.t might fail on a backtick
Bug-23825-KohaObjectt-might-fail-on-a-backtick.patch (text/plain), 1.64 KB, created by
Martin Renvoize (ashimema)
on 2019-11-13 16:17:14 UTC
(
hide
)
Description:
Bug 23825: Koha/Object.t might fail on a backtick
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2019-11-13 16:17:14 UTC
Size:
1.64 KB
patch
obsolete
>From 5e92119ad82d02ff910d9d15c773192e88ac2606 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Fri, 18 Oct 2019 09:31:10 +0000 >Subject: [PATCH] Bug 23825: Koha/Object.t might fail on a backtick > >If the SQL error message contains a backtick instead of a regular quote, >the regex for throwing an exception did not work. >Example: >Incorrect datetime value: 'wrong_value' for column `koha_master`.`borrowers`.`lastseen` >Note the backtics where the regex contains a regular quote. > >This patch makes it more flexible: it allows one \W character before the >column name, even optional. > >Test plan: >Run Koha/Object.t > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > Koha/Object.pm | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > >diff --git a/Koha/Object.pm b/Koha/Object.pm >index 108ea2e52f..f764e5ec0b 100644 >--- a/Koha/Object.pm >+++ b/Koha/Object.pm >@@ -174,11 +174,12 @@ sub store { > duplicate_id => $+{key} > ); > } >- elsif( $_->{msg} =~ /Incorrect (?<type>\w+) value: '(?<value>.*)' for column '(?<property>\w+)'/ ) { >+ elsif( $_->{msg} =~ /Incorrect (?<type>\w+) value: '(?<value>.*)' for column \W?(?<property>\S+)/ ) { >+ # The optional \W in the regex might be a quote or backtick > Koha::Exceptions::Object::BadValue->throw( > type => $+{type}, > value => $+{value}, >- property => $+{property} >+ property => $+{property}, > ); > } > } >-- >2.20.1
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 23825
:
94401
|
94654
|
94661
|
94662
|
94803
|
94804
|
95044
|
95053
| 95402 |
95403
|
95404
|
95405