From c95ea5297875c4514f192a3278a3eae86a188732 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Thu, 11 Jun 2009 16:38:39 +0000 Subject: [PATCH] Reverting Thingy RFE commit. --- docs/changelog/7.x.x.txt | 1 - lib/WebGUI/Asset/Wobject/Thingy.pm | 21 ++++++++------------- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 02da76460..ee6ede1cc 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -14,7 +14,6 @@ - refixed #10260: WebGUI::Asset::Wobject::Gallery.pm default search date misfunction - fixed #9953: Matrix 2.0 - Not enough tests - fixed #10121: Q and A template doesn't work with default Forum Rich Editor - - rfe #10423: Provide a way to access the instance of the thing that was added, modified, or deleted via workflow. (Eric Kennedy) - fixed #10486: Hardcoded extras in files in www/extras - fixed: LDAP authentication does not check for failed passwords. Bug added to 7.7.10. diff --git a/lib/WebGUI/Asset/Wobject/Thingy.pm b/lib/WebGUI/Asset/Wobject/Thingy.pm index 26bbaab53..27ed66a27 100644 --- a/lib/WebGUI/Asset/Wobject/Thingy.pm +++ b/lib/WebGUI/Asset/Wobject/Thingy.pm @@ -473,14 +473,14 @@ sub deleteThingData { return undef unless $self->canEditThingData($thingId, $thingDataId);; + $self->deleteCollateral("Thingy_".$thingId,"thingDataId",$thingDataId); + my ($onDeleteWorkflowId) = $db->quickArray("select onDeleteWorkflowId from Thingy_things where thingId=?" ,[$thingId]); if ($onDeleteWorkflowId){ - $self->triggerWorkflow($onDeleteWorkflowId, $thingId,$thingDataId); + $self->triggerWorkflow($onDeleteWorkflowId); } - $self->deleteCollateral("Thingy_".$thingId,"thingDataId",$thingDataId); - return undef; } @@ -598,13 +598,13 @@ sub editThingDataSave { my ($onAddWorkflowId) = $session->db->quickArray("select onAddWorkflowId from Thingy_things where thingId=?" ,[$thingId]); if ($onAddWorkflowId){ - $self->triggerWorkflow($onAddWorkflowId,$thingId,$newThingDataId); + $self->triggerWorkflow($onAddWorkflowId); } }else{ my ($onEditWorkflowId) = $session->db->quickArray("select onEditWorkflowId from Thingy_things where thingId=?" ,[$thingId]); if ($onEditWorkflowId){ - $self->triggerWorkflow($onEditWorkflowId,$thingId,$newThingDataId); + $self->triggerWorkflow($onEditWorkflowId); } } @@ -1390,7 +1390,7 @@ sub purge { #------------------------------------------------------------------- -=head2 triggerWorkflow ( workflowId, thingId, thingDataId ) +=head2 triggerWorkflow ( workflowId ) Runs the specified workflow when this Thingy changes. @@ -1404,17 +1404,12 @@ sub triggerWorkflow { my $self = shift; my $workflowId = shift; - my $thingId = shift ; - my $thingDataId = shift ; - my $workflowInstance = WebGUI::Workflow::Instance->create($self->session, { + WebGUI::Workflow::Instance->create($self->session, { workflowId=>$workflowId, className=>"WebGUI::Asset::Wobject::Thingy", methodName=>"new", parameters=>$self->getId - }); - $workflowInstance->setScratch("thingId", $thingId); - $workflowInstance->setScratch("thingDataId",$thingDataId); - $workflowInstance->start; + })->start; return undef; }