I find myself generating entityform submissions during the commerce checkout process and I'd like to keep them in draft status until checkout completes. However, there doesn't seem to be a rules action that allows me to change the submission draft flag from TRUE to FALSE. Using Set a data value tells me the The selected data property doesn't support writing, so that's a no go.

Attached patch creates an action which sets the Draft status to FALSE and saves the submission. It's defined in entityform.rules.inc, so won't affect installations that don't have rules installed.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

cafuego’s picture

Status: Active » Needs review
tedbow’s picture

Status: Needs review » Needs work

You shouldn't have to have specific action for this.

We just need to set the 'setter callback' property in:
EntityformMetadataController:: entityPropertyInfo()
here: http://drupalcode.org/project/entityform.git/blob/refs/heads/7.x-2.x:/en...

Then Rules will be able to set the property and you won't get The selected data property doesn't support writing,

cafuego’s picture

Status: Needs work » Needs review
FileSize
725 bytes
47.91 KB

Added the property with a setter callback, as per screenshot.

I'm not sure how to override the checkbox label of it that's even possible without adding a custom setter callback.

The last submitted patch, 3: 2146395-entityform-draft-action-3.patch, failed testing.

The last submitted patch, 3: 2146395-entityform-draft-action-3.patch, failed testing.

tedbow’s picture

The last submitted patch, 3: 2146395-entityform-draft-action-3.patch, failed testing.

tedbow’s picture

@cafuego, here is version of the patch that passes the tests. Can you confirm this lets you change the draft property via a Rules action?

We only need to set the 'setter callback' b/c other properties are set via:
$info = parent::entityPropertyInfo();

Thanks

cafuego’s picture

Status: Needs review » Reviewed & tested by the community

Yup, that works just fine - thank you :-)

tedbow’s picture

Status: Reviewed & tested by the community » Fixed

Ok, I have committed and fixed this

cafuego’s picture

Thanks!

Status: Fixed » Closed (fixed)

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