From d707bf8639e8c194e00783c33ff1b5b3e5a9ebd4 Mon Sep 17 00:00:00 2001 From: Erik Huelsmann Date: Sat, 25 Jan 2025 22:09:45 +0100 Subject: [PATCH] Follow-up to #8566: adjust persister concerns Fix the query invocation passing the workflow id (instead of 'undef') --- lib/LedgerSMB/Workflow/Action/TransactionApprove.pm | 4 ++-- lib/LedgerSMB/Workflow/Action/TransactionDelete.pm | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/LedgerSMB/Workflow/Action/TransactionApprove.pm b/lib/LedgerSMB/Workflow/Action/TransactionApprove.pm index c5ef24a587..45eae48862 100644 --- a/lib/LedgerSMB/Workflow/Action/TransactionApprove.pm +++ b/lib/LedgerSMB/Workflow/Action/TransactionApprove.pm @@ -37,14 +37,14 @@ Implements the C protocol. my $query = <<~'SQL'; select draft_approve(id) from transactions - where id = ? and not approved + where workflow_id = ? and not approved SQL sub execute( $self, $wf ) { $self->SUPER::execute($wf); my $dbh = $wf->handle; - $dbh->do($query, {}, $wf->context->param('id')) + $dbh->do($query, {}, $wf->id) or die $dbh->errstr; return; diff --git a/lib/LedgerSMB/Workflow/Action/TransactionDelete.pm b/lib/LedgerSMB/Workflow/Action/TransactionDelete.pm index d302a1b12c..5a38ff8096 100644 --- a/lib/LedgerSMB/Workflow/Action/TransactionDelete.pm +++ b/lib/LedgerSMB/Workflow/Action/TransactionDelete.pm @@ -37,14 +37,14 @@ Implements the C protocol. my $query = <<~'SQL'; select draft_delete(id) from transactions - where id = ? + where workflow_id = ? SQL sub execute( $self, $wf ) { $self->SUPER::execute($wf); my $dbh = $wf->handle; - $dbh->do($query, {}, $wf->context->param('id')) + $dbh->do($query, {}, $wf->id) or die $dbh->errstr; return;