diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 6e8577e3f..f4ae9d7c1 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -4,8 +4,8 @@ - fixed #4173: fieldnames in profilefields can contain spaces - fixed #8811: Bug Tracker: Formatting is bad for the resolution form. - fixed #9235: Image Bug in rich text editor. - - fixed #9219: Thingy After Save Search This Thing not showing all rows (SDH - Consulting Group) + - fixed #9219: Thingy After Save Search This Thing not showing all rows (SDH Consulting Group) + - fixed #9231: Singleton workflows should not report an error when an attempt is made to run them again 7.6.5 - security: A problem was discovered and fixed in which users could email executable attachments to a collaboration system and then when viewed online, could execute them. diff --git a/lib/WebGUI/Operation/Cron.pm b/lib/WebGUI/Operation/Cron.pm index 38ff395e0..05d848f7c 100644 --- a/lib/WebGUI/Operation/Cron.pm +++ b/lib/WebGUI/Operation/Cron.pm @@ -291,6 +291,13 @@ sub www_runCronJob { priority => $task->get("priority"), }); if ( !$instance ) { + if ($session->stow->get('singletonWorkflowClash')) { + $session->errorHandler->warn( + "Could not create workflow instance for workflowId '" . $task->get( "workflowId" ) + . "': It is a singleton workflow and is still running from the last invocation." + ); + return "done"; + } $session->errorHandler->error( "Could not create workflow instance for workflowId '" . $task->get( "workflowId" ) . "': The result was undefined" diff --git a/lib/WebGUI/Workflow/Instance.pm b/lib/WebGUI/Workflow/Instance.pm index fcab62bb3..5c8a795f2 100644 --- a/lib/WebGUI/Workflow/Instance.pm +++ b/lib/WebGUI/Workflow/Instance.pm @@ -73,8 +73,10 @@ sub create { $sql .= ' and parameters IS NULL'; } my ($count) = $session->db->quickArray($sql,$placeHolders); + $session->stow->set('singletonWorkflowClash', 0); if ($isSingleton && $count) { $session->log->info("An instance of singleton workflow $properties->{workflowId} already exists, not creating a new one"); + $session->stow->set('singletonWorkflowClash', 1); return undef }