Not sure if this is a bug or a support request -- flagging it as a support request as it may be an issue with me not doing this correctly. Trying to set the value of an entity property that I've just created in a series of rule actions (single rule).

The entity in question was created using ECK and I can see the property listed as one of the options in the set_data data selector options but when I paste the selection and try to save the action, I get an error 'The selected data property doesn't support writing'

In the action - create entity, there are no options to set any entity properties or fields and if I add a field and mark it required, then it still does not appear in the create or in the set_data wizard options. Only if I create the element as a property to the entity in ECK does it appear in the set_data wizard selections - this may be an ECK issue but was expecting to be able to select fields as well, but that's not what's holding me up being able to move forward. Not being able to set the entity property using the displayed rules selector is the issue.

I've tried adding an action to fetch the entity first and then adding an action to set_data the fetched entity property but that did not work either.

My end goal of this set of actions was to create a relation where presently one of the end points is not an entity - thus create the new required entity on the fly.

Any help or suggestions?

Comments

AaronBauman’s picture

Component: Rules Core » Rules Engine
Status: Active » Closed (works as designed)

This is basically a duplicate of #1057434: Troubles with actions 'Set a data value', though that issue applies to a Date field.

From what I gather, Rules does not dictate whether a data property can be set - it's the responsibility of the module that implements the field to provide an entity-api-compatible setter function that Rules uses to set the data value.

You do not mention the data type of the field you're having trouble with, but again - it's up to the module that provides that data type to ensure compatibility with entity api.

blainelang’s picture

Status: Closed (works as designed) » Active

@aaronbauman, in my case, it was a standard INT field. Should we not expect the core field types to support this ability?

AaronBauman’s picture

I am not having any trouble setting int fields with the latest (7.x-2.x-dev) version of Rules.
Try updating rules to dev, and make sure all your other modules are up to date.

ashuaviator1987’s picture

Component: Rules Engine » Rules Core

actually it depends on the entity data type which is getting set by rules. Like if you create an order(ubercart) entity type and set order id it wont allow as it is automatically created.You can assign only those value which require user intervention