Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#8 | entityform-draft_setter-2146395-8.patch | 481 bytes | tedbow |
#3 | Screen Shot 2013-11-29 at 3.44.44 pm.png | 47.91 KB | cafuego |
#3 | 2146395-entityform-draft-action-3.patch | 725 bytes | cafuego |
entityform-draft-action-1.patch | 1.25 KB | cafuego | |
Comments
Comment #1
cafuego CreditAttribution: cafuego commentedComment #2
tedbowYou 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,
Comment #3
cafuego CreditAttribution: cafuego commentedAdded 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.
Comment #6
tedbow3: 2146395-entityform-draft-action-3.patch queued for re-testing.
Comment #8
tedbow@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
Comment #9
cafuego CreditAttribution: cafuego commentedYup, that works just fine - thank you :-)
Comment #10
tedbowOk, I have committed and fixed this
Comment #11
cafuego CreditAttribution: cafuego commentedThanks!