Active
Project:
Reply
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
24 May 2012 at 16:40 UTC
Updated:
25 Sep 2014 at 07:33 UTC
Jump to comment: Most recent, Most recent file
If a module wants to hook into reply and use the entity api to set particular properties it is not able to do so since the 'setter callback' has not been defined. This prevents modules like rules from being able to set useful properties such as 'status' etc ... Or create reply entities on the fly.
I also added an options list for the entity_type property field so that it will be usable in views filters, rules, etc.
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | add-callbacks-1599038-7.patch | 1.53 KB | a.ross |
| #1 | reply-add-setget-property-callbacks-1599038.patch | 1.59 KB | acrazyanimal |
| #2 | reply-add-setget-property-callbacks-1599038-1.patch | 2.04 KB | acrazyanimal |
Comments
Comment #1
acrazyanimal commentededit: this patch is missing the options callback so ignore it, its no good.
Comment #2
acrazyanimal commentedWoops forgot to merge in the options callback. Here is a working patch.
Comment #3
james.williamsI'm not sure how useful this is ... I applied the patch, but I still couldn't create reply entities with Rules, and the individual properties still seem available to Rules without the patch?
Can you outline a testable situation that the patch solves?
Comment #4
acrazyanimal commentedDid you try using the 'set data value' rule on any of the properties all the way to completion? When I tried, after selecting a particular property and clicking continue, it brought me back to the same selection screen with a message "status cannot be set" or something like that. Also, I found that not all the properties were present in the list.
Here is a test:
Use an event like 'Reply is saved'
action: "set a data value" - choose 'status' from the data selection widget.
click continue
You should now see the error regarding not being able to set it.
This same error is received for all the properties as far as I can remember.
The patch also adds a options list callback for entity types rather then having to type in the machine name of an entity type.
I was able to create a reply through rules using a create entity rule in combo with a series of set a data value to select the entity type and entity id properties, etc.
Hope that all helps.
Comment #5
acrazyanimal commentedI'd like to point out that this isn't just a rules thing. It will also help in views integration, VBO, view modes, custom edit interfaces for replies that another contrib module developer may wish to create, etc.
Comment #6
mgiffordPatch no longer applies (against git master branch):
$ git apply reply-add-setget-property-callbacks-1599038-1.patch
error: patch failed: reply.module:1708
error: reply.module: patch does not apply
Comment #7
a.ross commentedHere's the patch rerolled against the latest revision. It gets us a little further, but I still wasn't able to create entities, since I can't choose bundle type.
Comment #8
pameeela commented