Search in group Search
Architectural Use Case: Rules Interaction Across Sites
I have a question about rules operating across entirely separate Drupal 7 sites.
I am designing a client's application as N (N < 6) separate Drupal 7 sites for perforamnce, scalability, and security reasons. Traditional Muliti-site is not an option as they need the option to place different sites on entirely different servers. (see footnote) The sites are linked by 1) pushing content via the Deploy module (i.e. a backend 'publishing' workflow), 2) Single Sign On (with e.g. the Bakery module), and 3) shared business logic.
Read moreHierarchical Taxonomy With Rules (tutorial)
Sorry if this is a duplicate.
GOAL: when a user selects a taxonomy from a field, add the parent nodes for that field as well.
The Rule
EVENT
After saving new content
After updating existing content
CONDITIONS (optional)
Content is of type (your node type)
ACTION
Execute custom PHP code
The code
[code]
$parents=taxonomy_get_parents_all($node->field_location['und'][0]['tid']); //gets all parents and self for the term added
$t=array();
foreach($parents as $p){
$t[]=get_object_vars($p); //convert the objects to arrays
}
How do I get a field (of a custom type) to appear in the Data Selector?
Hi everybody, I'm using a development version of the WebSite Screenshot module which creates a new Formatter and Widget for fields to display screenshots (powered by a screenshot service) of URLs entered into the Drupal system. I have the URLs coming into one text field and I want to copy this value into the custom field created using the Screenshot type. My problem lies with the 'Set a Data Value' action.
Read moreLoading from Views seem not to work
In Drupal 7, I have a content type "Doc" with 3 custom fields. All three are node reference fields.
I have also Views|X page to select particular Doc node(s) when 3 arguments are provided. Filter works fine in Views.
However, loading to Rules the first View using these 3 fields as arguments is ineffective. Always I get error in debug like this:
- 9.119 ms Evaluating the action rb_misc_action_views_load_node. [edit]
- 82.91 ms Unable to get variable node_views, it is not defined.
Different kinds of loops with Rules
One of the most useful parts of Rules is the "list loop" functionality. But I'm having a hard time figuring out how to do other kinds of common loops, like while() and for() loops.
My use case is simple. People can buy e-cards at the (Commerce-powered) web-store. When you buy an e-card, Rules handles sending the actual card. When you buy 3 of an e-card, it should send out 3 emails. But quantity is just a field on the line-item. So I'd like something like this:
<?pseudo-code
$quantity=[commerce-line-item:quantity];
do while ($quantity > 1) {
Read moreCreate a new user and include the user password in an automatic Email message
I've recently started using the Rules module on a site I manage for a fellowship program.
We have two user roles: applicants and references. When an applicant completes his/her application, I'd like to have three new reference accounts set up, based on information the applicant enters on the application form. I've set up Rules to create the new user accounts with a role of "reference" and send an automatic Email message to the three references, with instructions on how they should proceed to set up their reference forms for the applicant.
Read moreFail when cascading creating user + adding user to a role
This afternoon, I tried to automate user creation. Users are clients and I want to have their account created from their CRM details (content type # Client).
So, I tried this rule:
1- event: after saving new content
2- condition: content type = Client
3 - actions
a- create new entity "User". Username = mail, mail = mail
b- add user role (parameter: entity-created) + specify a role
It looks OK, but when I try to create a new "client", I have the following error message:
Read moreSend mail when field has new item
Hi there,
I think what I'm trying to accomplish is pretty straight forward, but I just can't seem to get it to work properly.
The setup is as follow:
- I am using Drupal 7
- I have a field on my user accounts where I can add files my users can download when they have logged in
- There is no limit to the amount of files that can be added
What I am trying to accomplish:
<
ul>
Custom code in Rules not returning array value
I have a pretty simple action that takes values of two fields, then values of the fields from another node (added and available via another action) - as ranges, then compares the two field values against these ranges, assigns integers matching given ranges to two temp vars. Then these vars are compared and the one with the greater value should be returned as the value in the array for this field. But I look at debug and have a NULL in this array - the values do not get passed. Am I doing something wrong with the temp vars? This should be very simple.
Here is the code:
<?php
Read moreAlter bundle
I tried to alter bundle_a to bundle_b, both having some common fields. Used Alter bundle action:
bundle_a
bundle
bundle_b
No effect. Missed something?
Read more