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 (?\w+) value: '(?.*)' for column '(?\w+)'/ ) { + elsif( $_->{msg} =~ /Incorrect (?\w+) value: '(?.*)' for column \W?(?\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}, ); } }