As most people in this group probably knows already, I'm quite keen on the Rules module.
I usually only configure Drupal, but lately I've started to try some coding as well. My main motivation for this is to be able to write Rules actions (and hopefully events and contitions in due time).
When configuring Rules myself, and answering questions from others about how to configure Rules, I've felt that there have been some actions missing. It would be very interesting to start a Drupal project "Rules Bonus Pack", that could work as a garden centre for new Rules actions (and events and conditions) – and when/if some of them become mature enough bring them into Rules (or related modules).
As a proof of concept I'm attaching an example module CCK copy, that copies the value of a CCK field to another CCK field.
(This can often be done by using tokens and the action "Populate CCK field", but this doesn't work when the widget doesn't allow entering tokens.)
So:
- Would Rules Bonus Pack be useful?
- Is it crazy to have a non-coder (essentially) as project maintainer? My thoughts are that I could provide more and more actions as time goes by, but also that others will have a greenhouse to send their custom actions to – not that I should write all code lines myself.
Thoughts and comments are welcome!
//Johan Falk, NodeOne, Sweden
EDIT: An updated attachment now also contains actions for copying taxonomy terms. More will hopefully come.
| Attachment | Size |
|---|---|
| cck_copy_action.zip_.txt | 2.29 KB |
| rules_bonus.zip_.txt | 5.2 KB |

Comments
I think it is a good idea
thank you for the contribution
Another idea:
What about promoting and demoting OG managers(OG authors)?
Great idea!
That's definately something that could be contributed!
Unfortunately I know very little about OG, so it will have to be written by someone else. ;-)
//Johan Falk, NodeOne, Sweden
I think this would be a great
I think this would be a great idea as a way to introduce new rules to users and hopefully get them added to the rules module or other contribs.
-
@foggyperspectiv | foggyperspective.com (blog)
I'm using the copy cck action module
Module works great! Thanks for creating it.
There do seem to be some interesting side effects.
I created two rules, one for updates to a node and one for creating the node.
I have a cck field called "field_city" and one called "field_city_new". Field city is set up as a select and field city new is set up as a text field. When someone types something into field_city_new, I update field_city to the new value and I change field_city_new to a null field.
The side effect is when I edit the node, the field_city_new field does not display the updated value even though I can see the correct value in the database and when using views. I'm guessing that this is a caching issue and that perhaps the module needs to update some variable in memory so that the edit node will show the change appropriately. Maybe it's related to the fact that I have sql code in my php section to do a distinct list of the field_city column for my select list of display items. Anyway, just a thought that you might consider looking at.
Again, thanks for the module, it's great.
Bob
Bob Brown
Great idea! Would Rules
Great idea!
Definitely. I think in contrast to the usual rules module integration it should be easy for stuff to get into the bonus pack, but with that disadvantage of possible having no upgrading path to the next major version release.
Sounds good!