When new content is created and the state changes from creation state to another state it was impossible to trigger a notification. I have added a new hook, insert, which allows to notify an event not when workflow is updated but also when a new content has been just created. I have also modify workflow module to allow from workflow Notification form to include new trigger when state goes from Creation to any other state. I have also corrected mistypo in a file. I attach here the patch for both files. For more info contact me.

Regards, Ricardo

Comments

rhsantos created an issue. See original summary.

johnv’s picture

johnv’s picture

I have checked both your patches.
However, i am not sure if this is needed.
the Creation state is not selectable by purpose. The Workflow patch makes it available every where.

Perhaps it is sufficient to use hooK_entity_insert, and then call workflow_get_workflow_field_names(), to check if this is a Workflow entity.

rhsantos’s picture

Thanks for your answers Johnv,

It was just my solution, I needed to send email when new content is created and inserted in the workflow but there was no way to select creation state, so I did on my own. I just think it is desirable to have the option to notify when creation is done.

Regards, Ricardo

anas_maw’s picture

Version: 8.x-1.x-dev » 3.0.x-dev
Status: Active » Needs review
StatusFileSize
new2.02 KB

@johnv please review this patch, adding hook_entity_insert will solve the issue

jrochate’s picture

StatusFileSize
new3.8 KB

I have made a small array test to avoid null / empty $data array.

jrochate’s picture

jrochate’s picture

  • johnv committed caf353fd on 3.0.x
    Issue #3120004 by jrochate, anas_maw, rhsantos, johnv: Create...
johnv’s picture

Version: 3.0.x-dev » 3.0.0-beta5
Assigned: rhsantos » Unassigned
Status: Needs review » Fixed

Indeed, the hook_entity_insert() was missing in both submodules.
Fixed in 3.0.x

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.