Search in group Search
Update fields by PHP
My requirement is to use Rules to modify a field value before save. The rule is field_final (changed) = field_final (unchanged) + field A (changed) - field A (unchanged)
I can use several actions (calculate a value, set a data value) to do above job and it works. But I want to use a custom PHP to do it, is there a sample code to do it?
I need to know how to get unchanged/changed value and how to set changed value, thanks.
Btw, I try use to the follow commands to test but they don't work (I use a hard-code value '123' to test only)
$node->field-final['und'][0]['value'] = 123;
URL redirect for first time users
I need to create a rule that redirects users to their user account edit page if the email field is blank. I have gotten it to work with the redirect, the part I'm having a problem with is having this only show up is the email field is blank. Here is what I put in the Execute Custom PHP Code field:
<?php
return ($account->[account:mail] == 0);
?>I looked at this video: http://www.slurpitup.com/drupal/redirect-user-using-rules-based-on-a-pro..., but using the Truth statement didn't work. So I thought I could just put the code in the PHP area. Any thoughts?
Read moreRules link - Improving the UI
Hey fellow Rules users,
I don't know how many of you already know my module Rules Link - Itangalo created two very cool screen casts about it here (basics) & here( advanced stuff) - but for those already know the module:
Rule to not to allow content editing after a fixed amout of time
I am trying to create a rule (in 6.x) for a CCK node type edit form. I am trying to create a rule for Node edit form is being built.
If the content previously created is X days old I would like to deny user editing the content. But if it is less than X days old then the editing should resume as normal.
Any Ideas/thoughts? Am I on the right track? or should use a different approach. I prefer not to trigger the rule for each page view (and disable the edit node tab altogether) as that will be too costly in processor type. Rather want to trigger a message when there is intention to edit.
Read moreEvent on revision comparison.
Hi All,
Just started using rules after watching some screencasts etc. as expected I have hit a problem straight out the gates..
I have a content type with an entity reference field referencing a user.. I am using content_access and ACL and I want a rule that will update the permissions granting view and edit permission to the referenced user..
I have it working if I reset the permissions to those of the content type and then add view and edit permission to the referenced user.. The problem is that this would remove any manually added permissions as well..
Read moreRules does not allow to populate content profile field
Could someone explain what is happening here? I have a content type that is a part of content profile. It has a numeric field "latest" that I am trying to update every time the user saves a value in another regular content type "miles" via a field called "miles_record." So when "miles" content is saved, I want to update the content profile field "latest." Rules does not seem to allow this.
I am trying to do the following:
On Event: Saving New content
And created content is: miles (this is the CT for entering "miles_record" filed values)
Node and Field Reference
Is there way to avoid field copying from referenced nodes by using rules? Is there a way to grab just a reference to any field in the referenced node?
Read moreUsing Rules to email multiple users in drupal 7
Goal: To send a email to a multiple users informing him that a product ( content type ) he bookmarked ( using Flag module) has been updated.
Few things to consider:
If many products get updated then one email with a summary should be sent out.
Each user using flag module selects his product of choice.
Where I am stuck using the Rules Module:
I can't seem to get the condition right in rules so that it executes the way I want it.
How to create OG group when role is changed with rules ?
Hi,
We are using content profile at time of registration. After reviewing user details we want to assign user with some special previllages (for that we have role say master). Now when we assign role to this user then with help of OG module we would like to create one group with title of user name. We tried to do it with Rules module but we are not getting it. can you help us how to do it.
We have following steps in rules.
Event : User account details have been updated
IF
User has role : masters (updated users)
DO
Load updated users content_profile
Some help with some rules please?
Hi,
I am hoping that someone can help me. I am digging around in the rule creation window; I have already created a bunch of rules to create add and remove user points.
I am having a problem with using Rules to add user points to a referrer. I have created a text field where a new user who is registering can enter the username of the individual who referred them to the site. The goal is to award a certain number of user points to the referrer on sign up.
Read more
