summaryrefslogtreecommitdiff
path: root/LedgerSMB
diff options
context:
space:
mode:
authoreinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2008-05-19 22:36:45 +0000
committereinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2008-05-19 22:36:45 +0000
commit819ab93566e8e604e756ac4646c87e46e59ee7ad (patch)
tree43ed7c5f29991f57ea7167edf323c3fe1eb9c662 /LedgerSMB
parent5a0e273bc0edbd031aecacbc485309db0707712f (diff)
Correcting problem in DBObject.pm constructor
Correcting method->procedure mappings for DBD::Pg 2.0 and above. git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@2152 4979c152-3d1c-0410-bac9-87ea11338e46
Diffstat (limited to 'LedgerSMB')
-rw-r--r--LedgerSMB/DBObject.pm21
-rwxr-xr-xLedgerSMB/Template.pm1
2 files changed, 10 insertions, 12 deletions
diff --git a/LedgerSMB/DBObject.pm b/LedgerSMB/DBObject.pm
index 94a26bb3..07b2b0a6 100644
--- a/LedgerSMB/DBObject.pm
+++ b/LedgerSMB/DBObject.pm
@@ -65,7 +65,7 @@ sub new {
$self->error('Mergelist not set');
}
else {
- @mergelist = [];
+ @mergelist = ();
}
if ( !$base->isa('LedgerSMB') ) {
$self->error("Constructor called without LedgerSMB object arg");
@@ -122,19 +122,16 @@ sub exec_method {
my $args = $ref->{proargnames};
my @proc_args;
- $ref->{pronargs} = 0 unless defined $ref->{pronargs};
- if ($ref->{pronargs}){
- $args =~ s/\{(.*)\}/$1/;
- @proc_args = split /,/, $args if $args;
- }
-
+
if ( !$ref->{proname} ) { # no such function
$self->error( "No such function: $funcname");
# die;
}
-
- if ($args) {
+ $ref->{pronargs} = 0 unless defined $ref->{pronargs};
+
+ @proc_args = $self->_parse_array($args);
+ if (@proc_args) {
for my $arg (@proc_args) {
if ( $arg =~ s/^in_// ) {
push @call_args, $self->{$arg};
@@ -249,14 +246,14 @@ sub run_custom_queries {
sub _parse_array {
my ($self, $value) = @_;
return @$value if ref $value eq 'ARRAY';
-
+ return if !defined $value;
my $next;
my $separator;
my @return_array;
while ($value ne '{}') {
- my $next = "";
- my $separator = "";
+ $next = "";
+ $separator = "";
if ($value =~ /^\{"/){
while ($next eq "" or ($next =~ /\\".$/)){
$value =~ s/^\{("[^"]*".)/\{/;
diff --git a/LedgerSMB/Template.pm b/LedgerSMB/Template.pm
index 35602cb4..3a92e1c2 100755
--- a/LedgerSMB/Template.pm
+++ b/LedgerSMB/Template.pm
@@ -235,6 +235,7 @@ sub render {
throw Error::Simple "Invalid format";
}
my $format = "LedgerSMB::Template::$self->{format}";
+
# if ($self->{myconfig}){
# $self->_preprocess($vars);
# }