Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(core): Workflow Action Endpoint does not return the contentlet metadata #28338 #28369

Merged
merged 8 commits into from
May 10, 2024
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