Skip to content

Commit

Permalink
#28338 doing hydrated content on wf
Browse files Browse the repository at this point in the history
  • Loading branch information
jdotcms committed Apr 26, 2024
1 parent c84abae commit 86ab17b
Showing 1 changed file with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
import com.dotmarketing.portlets.contentlet.model.ContentletDependencies;
import com.dotmarketing.portlets.contentlet.model.IndexPolicy;
import com.dotmarketing.portlets.contentlet.model.IndexPolicyProvider;
import com.dotmarketing.portlets.contentlet.transform.DotTransformerBuilder;
import com.dotmarketing.portlets.structure.model.ContentletRelationships;
import com.dotmarketing.portlets.workflows.actionlet.WorkFlowActionlet;
import com.dotmarketing.portlets.workflows.business.WorkflowAPI;
Expand Down Expand Up @@ -1613,15 +1614,12 @@ private Response fireAction(final HttpServletRequest request,

//Empty collection implies removal, so only when a value is present we must pass the collection
categories.ifPresent(formBuilder::categories);

final Contentlet basicContentlet = fireCommandOpt.isPresent()?
fireCommandOpt.get().fire(contentlet, this.needSave(fireActionForm), formBuilder.build()):
this.workflowAPI.fireContentWorkflow(contentlet, formBuilder.build());
final Contentlet hydratedContentlet = new DotTransformerBuilder().contentResourceOptions(false).content(contentlet).build().hydrate().get(0);
return Response.ok(
new ResponseEntityView(
this.workflowHelper.contentletToMap(
fireCommandOpt.isPresent()?
fireCommandOpt.get().fire(contentlet,
this.needSave(fireActionForm), formBuilder.build()):
this.workflowAPI.fireContentWorkflow(contentlet, formBuilder.build()))
)
new ResponseEntityView(this.workflowHelper.contentletToMap(hydratedContentlet))
).build(); // 200
}

Expand Down

0 comments on commit 86ab17b

Please sign in to comment.