Search in group Search
I need help understanding data selectors
Hi!
I'm trying to use data selectors in Rules 2.0 on Drupal 7.x. It seems like a very promising feature, but I feel like I really don't understand enough about it.
a) Can I only use the data that appears in the list dynamically, or can I access any data as long as I understand the syntax?
b) How exactly does the syntax work and what does it mean?
Thanks!
Ben
Changing Data Value using PHP code / Fetch by Property in Rule Action - D7
I've ran into the following issue in Drupal 7:
I need to be able to, upon saving a new (or existing) node, set one of the fields with the value of a field of another node (of different type). The field type is node_reference. These is my current setup:
Event -> Before Saving Content
Condition -> Data Comparison: [node:type] -> TYPEA
Condition -> PHP Code:
$result = db_query('SELECT 1 FROM {field_data_field_myfield} n WHERE n.bundle=:mybundle AND n.field_myfield_value=:myvalue', array(':mybundle' => 'TYPEB',':myvalue'=>'[node:field_myfield]'));
Rule condition: if field is empty?
Scenario: The member has completed the Annual Certification requirement. Change the OG Group membership from 'Intern' to 'Tech', if this is their first time Certification. Confirmation that this is their first Certification comes from verifying that the Previous Years field is empty.
Field previous_years is a multiple values CCK field. Do you see anything wrong with my php code? It should Return '1', if the field is empty.
ON event After updating existing content
IF...
Updated content is type XYZ
AND
Updated content's field is 'certified_year'
AND
Action firing before node id saved to DB
Created an Action and set it to be triggered by the "After saving new content" event.
The Action reads all the nodes of the type just created and puts certain fields into an XML file. It works except the node created is missing. It appears that it has not yet been written to the DB.
The log (see attachment) shows that my Action is firing before the node is Saved.
Is there a way to have an Action trigger after the node is saved?
Thanks,
Michael.
Rounding converted currency values
I have just created a rule that converts a value from one currency to another for Drupal Commerce
The rule is triggered by "Calculating the sell price of a product"
with the condition "Data compare" on [commerce-line-item:commerce-unit-price:currency-code] = "
and actions: "Convert the unit price to a different currency" and "Multiply the unit price by some amount".
So far so good, however I intend to ensure the value is always rounded upwards to the next value without decimals.
Read moreHow to handle " Pre unpublish validations" ....?
I want to add a workflow for unpublished content using Rules.
scenario is like this:
1.The normal user can request to unpublish content.
2.A mail wiil go to admin & editor that "xyz content is pending for unpublish"
3.Admin will review it & whtever action will take.
Now here in point 1, I want to create an event " request for unpublish content"
I referred this post but my idea is not clear for this case
http://drupal.org/node/298549
in short i need action "pre unpublish" like we have presave.
any suggestion ....guys...??
Read more"Learn Rules" screencast series started!
I have at last started recording a new screencast series, introducing and eventually going quite deep into Rules for Drupal 7.
I have previously made a screencast series about Rules 1 (for D6), but the differences between Rules 1 and Rules 2 are so big that a new screencast series is quite motivated.
Read moreProvide more "data selectors" for machine names
First of all thanks a lot for all the hard work on this awesome module to everybody who contributed to it.
I am trying to do the following : create a new vocabulary every time a specific content type is created.
Read moreHow to publish a revision with a rule but without the "publish revision" permission is checked ?
Hi,
I'm trying to explain my problem.
I configured a workflow with several states, users and activate the revisioning module.
I don't used triggers, only the rules module
Ok
In my case, a simple user can save some contents and an email is sended to another user to validate them.
But, for some minor updates content, I want this user can publish directly theses update on the site (bypassing the workflow)
For that, I added a checkbox (publish directly) in my content type (a CCK field -> field_pub_directe) and in a rule to check and publish the content.
Read morestuck with "Specify the fields value with PHP code"
Hello all,
iam making a kind of automated notification system for my partners when a certain node type has been published...
The following text displays the setup:
IF
conditionCreated content is Review indent
AND
conditionCreated content is published indent
AND
conditionCreated content's field 'field_label' has value
DO
actionLoad content by id
actionSend a mail to an arbitrary mail address
