Is it possible to trigger an action based upon the condition of a checked field in the user profile?
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | profile_rules-4.tar_.gz | 1.41 KB | OliverColeman |
| #10 | profile_rules-3.tar_.gz | 1.46 KB | OliverColeman |
| #7 | profile_rules-2.tar_.gz | 1.81 KB | OliverColeman |
| #4 | profile_rules.tar_.gz | 1.06 KB | mradcliffe |
Comments
Comment #1
PeterErnst commentedInteresting Question. Subscribing
I'm particularly interested on how to change a user role after a checked field in a User profile (or on a Content Profile page) using a trigger and an action based upon the condition of a checked field.
Comment #2
filpet commentedSubscribing!
Comment #3
fagoRelated issue: #363682: User account update rule doesn't include Profile updates
There isn't any profile module integration yet. Personally I'm using content profile instead, however I'd be happy to commit patches adding profile module integration.
Comment #4
mradcliffeI wrote up something quick today to handle basic profile field conditions and date profile field conditions. At the moment it's as its own module (not a patch).
This should give you a start. The method that grabs the profile fields of generic type or date should probably be expanded to sort out via select/checkbox items, date items, and text items (textarea, textfield, url, etc...), but I didn't need that functionality myself yet.
Comment #5
deggertsen commentedThat worked like a charm! It would be great to see this integrated or created as its own module. It does need the work as mradcliffe stated but what's there currently works great!
Comment #6
YK85 commented+1 subscribing - do you think there is a chance to get this adding to Rules module as profile fields are in core? thanks!
Comment #7
OliverColeman commentedI've added to the profile_rules module provided in #4 Actions that allow setting a profile field value. Would be great to see this (though probably with some changes) included as an optional module along with Rules...
One of the changes would probably be to allow PHP processing for the conditionals (the Actions for setting a value already allow PHP processing). The other change would probably be Token support...
Comment #8
OliverColeman commentedHmm, those should probably have been created as Rules Actions (and not Drupal core Actions). I'll probably do this some time soon.
Comment #9
izmeez commentedsubscribing
Comment #10
OliverColeman commentedOkay, attached is a new version that uses Rules Actions. It also allows token replacement and PHP processing for both conditions and actions, and handles date fields more elegantly (I reckon anyway :)), just using a single action and condition for all field types and accepting dates in string format.
Comment #11
OliverColeman commentedWell, this is a bit embarrassing, but here's another version in which the Condition and Action actually works for date fields...
Comment #12
mr.andrey commentedsubscribing... +1 to including this as part of rules module.
Comment #13
comfused commentedjust tried this add-on-module
but I can't seem to get a rule triggered when a user updates his personal information
what I'd like is to update the users role after he completes his personal information form
Comment #14
comfused commentedanyone ?
Comment #15
mradcliffeI never actually needed any of what I did here as I went in a different direction. I don't have much time to look at it anymore, sorry.
Comment #16
jorditr commentedHi you all. I've tried to use that small module on #11, but it doesn't appear on my modules list (in fact the whole .module file is empty). The ones that have tried it, what have you done to have it working?
Thanks.
Comment #17
jorditr commentedOk, I've seen it was looking on a wrong place. I've modified the .info file to have it on the same Rules group.
Comment #18
fizk commentedWhat's the status of this issue?
If the Rules maintainers want this functionality to exist as a separate module, I will create a new project using the code from http://drupal.org/node/658504#comment-3241944
Comment #19
clemens.tolboomI've updated the patch from #363682: User account update rule doesn't include Profile updates #49.
The (non) patch from #11 does comparison of profile field values which can be accomplished by using the http://drupal.org/project/token_profile and rules compare conditions for text/numeric/boolean.
The only comparison not yet possible through #363682: User account update rule doesn't include Profile updates and standard rules comparison is the date field so I've added #1488574: token_profile does not explode profile date field into year, month, day parts to token_profile making rules compare conditions for text/numeric usefull for comparing profile dates.
I would say we can close this issue and all move over to #363682: User account update rule doesn't include Profile updates.
What do you think?
Comment #20
tr commentedDrupal 6 end-of-life was more than two years ago - there will be no new feature in D6 Rules, and D6 Rules is no longer supported.
That said, this could go into Rules for D7 or D8 if someone is willing to contribute code or fund the development of this feature.
Comment #21
tr commented