Hello,
I manage my form using EntityForm module and then add a hidden field.
After that, If I add a Rules' action "Set data value" (sorry if it not the right label, I'm working on a French Drupal), the hidden field is not listed in the data selector.
As three modules are involved (EntityForm, Rules and Hidden Field), would you please excuse me if FieldHidden is not concerned but I have to start somewhere ;-).
Thanks
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | field_hidden-rules_data_selector-1472050-9.patch | 1.63 KB | jacobfriis |
Comments
Comment #1
jacobfriis commentedRules are truly great, but it's often pretty hard to make them do exactly what's on one's mind.
I will myself in a week or so be making rules which involve Field Hidden fields - so if that doesn't work out as expected, I will certainly look into this issue.
And I would be pretty surprised, because from an entity point of view a field is pretty much a field, no matter it's type.
Please post a comment if you find more specific clues that indicate that there is an issue
- or if you realise that it was quite a different matter ;-)
Comment #2
jacobfriis commented@MI
You're right - a Field Hidden field doesn't appear in Rules' list of 'Data selectors'.
I will try to fix it.
If this module is allowed to use the same types as the 'native' field modules, it may work out.
Comment #3
jacobfriis commented@MI
Thanks a bl.... million for finding this inadequacy of the module.
Turned out that fixing the issue was extremely easy; adding a property_type:text attribute to the type declarations of the module's hook_field_info() implementation.
That's the beauty of working on a platform that has a rich community - took me no time to find these super relevants posts:
Entity API (and Rules) integration for mediafield and Property info for fields.
I've tested rules integration by creating a rule which listened to the value of a hidden text field, and changed the value of another hidden integer field - and that worked swell (after this fix, that is ;-).
I have no idea if there's still is a problem when working with the EntityForm module. Please tell me if there is.
I doubt that this module would be able to do much about that - but please tell me anyway.
The issue is fixed in the latest release, 7.x-1.2.
Comment #4
philyYou're welcome ;-) I'm am sincerely very happy for my first help the the community !!!
But to be honest, as I am also using the Field Permissions module for other purposes in the website, I find it easier to use a regular field and hide it with appropriate permission....
Comment #6
beniamin.szaboHi,
I found another problem with rules. When i need to select integer value, in data selection, Hidden Integer is not listed. It appears that if i need to select text value the Hidden Integer is listed as well.
I looked in the code and in field_hidden.module at line 128 the property_type for field_hidden_integer is 'text'. I changed it to 'integer' and that fixed the problem.
Comment #7
jacobfriis commented@BenSF
Awesome!
I'll test it this weekend and roll a patch and a release.
Comment #8
beniamin.szaboGreat!
Thanks for the quick response. ;)
Comment #9
jacobfriis commentedWell, a patch at least, for now.
Comment #10
jacobfriis commented@amitsedaiz
I would like to make a new 7.x release, which alters nothing but incorporating the fix to this issue.
I don't expect any other changes to 7.x in the future, so this would sort of wrap up things nicely for 7.x.
Comment #11
amitsedaiz commented@PhilY and @BenSF: Great Work.
@jacobfriis: Tested it and found it integrating with rules very well.
I began looking into how native field types support rules integration via property_type. I found
property_typeis missing in number.module file innumber_field_info(). However, in theentity_field_info_alter(&$field_info)in entity.property.inc file for the common field types,property_typehas been added by the entity.module.Please go ahead with creating a new release if required. I guess it makes sense to work on using
hook_widget_info()to specify hidden widget type for the common field types in D7 so that any such future possibilities which other modules provide may be taken care of. I will work on it for sometime and keep you updated. Thanks.Comment #13
jacobfriis commentedFixed in release 7.x-1.7.