Make sure SQL parameters are stringified (for overloaded entries) before converting to json for debug output
This commit is contained in:
parent
5a1619f4f7
commit
83a3ed6983
2 changed files with 4 additions and 3 deletions
|
|
@ -330,8 +330,9 @@ sub query {
|
|||
my $placeholders = shift;
|
||||
$self->{_queryCount}++;
|
||||
my $plac;
|
||||
if (defined $placeholders and ref $placeholders eq "ARRAY" && scalar(@{$placeholders})) {
|
||||
$plac = "\n with placeholders: " . JSON->new->encode($placeholders);
|
||||
if (defined $placeholders and ref $placeholders eq "ARRAY" && scalar(@$placeholders)) {
|
||||
my @placeholders = map {ref $_ ? "$_" : $_} @$placeholders; # stringify objects
|
||||
$plac = "\n with placeholders: " . JSON->new->encode(\@placeholders);
|
||||
}
|
||||
else {
|
||||
$plac = '';
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ package WebGUI::Session::Form;
|
|||
|
||||
use strict qw(vars subs);
|
||||
use WebGUI::HTML;
|
||||
use Encode;
|
||||
use Encode ();
|
||||
use base 'WebGUI::FormValidator';
|
||||
|
||||
=head1 NAME
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue