I needed a rule to fire anytime a certain field is changed. The usual approach with Rules is to fire on "Content changed" and compare the field values to check if they changed. However, Editable Fields doesn't call the node_save() sequence.

I think proper support would be to have a Rules event to fire anytime a field is updated.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jdlind38’s picture

+1. I agree with Fabian

franz’s picture

I think you meant Franz, Fabian is Fabianx

Maedi’s picture

+1 but does anyone know of current workarounds to this problem? Perhaps a hook that triggers node_save() in the background via the AJAX request?

charlie-s’s picture

I am currently firing off lots of rules on "After updating existing content" via an Editablefield and comparing the node-unchanged and node. Are you folks not able to get this to work? This is with dev.

ilyasmdgh’s picture

I tried with 7.x-1.x-dev . After updating existing content does not trigger with editable fields.
The field is a list for selecting a simple yes or no.

The action I use is page redirect for testing. This does not work for me.

Can you please help me with this. How actually are you using it with the comparisons

presleyd’s picture

Test this with a different action to confirm that your action settings aren't at fault. I made a simple rule just now triggered off of an update to existing content and a single condition (that it was of a certain content type). The action I used for testing was to send me an email. Toggling both an autocomplete field as well as a text select list seemed to trigger fine.

ilyasmdgh’s picture

Thanks for the reply.

I did a simple 'set data value' as the action, and yes it did trigger it. I also tried with 'send an email'.

The problem I faced is that this rule is triggered after moving away from the page or page reload.
I guess this is how it is supposed to work.

What I require was to trigger the rule as and when the field was saved on the same page for my workflow to work. Please help if you think i am missing something here.

presleyd’s picture

If I'm understanding what you are saying: You are trying to change one field's value and cause it to update the value of another field in the node that you are viewing?

If so, the rule is actually triggered immediately. Your action is only noticeable on a page reload because the 'set data value' doesn't asynchronously refresh the field on the page you are viewing. You could, of course, refresh the whole page with a rules action but that's probably not what you're after. Nor can I think of a good way of doing this without custom javascript.

zdean’s picture

I would be ok with a "refresh" action, but I don't see that action available in Rules. Am I overlooking something?

presleyd’s picture

System->Page redirect used to work in 6 if you selected to option to immediately issue the refresh, I just realized this option is no longer in Rules for Drupal 7. I suppose a PHP snippet would work if you have PHP filters enabled.

zdean’s picture

Thanks...I'll look for a snippet and paste back here if I come across something. If anyone here knows the snippet to use, it would be appreciated!

zdean’s picture

I've had no luck with this...wondering if anyone can provide some direction on the snippet that could be used.

thanks!

koppie’s picture

Status: Active » Closed (fixed)

At this point (a year later), it looks like editablefields properly triggers the "after updating existing content" event.

vaccinemedia’s picture

Status: Closed (fixed) » Active
FileSize
82.25 KB

Hi Guys, hope you don't mind me re-opening this one. I have the dev version of editable fields and Rules 2.3. I have created a view which due to the design has to be in a block which contains editable fields. On changing the values the rule I have set for the event of "After updating existing content" is not triggering a redirect action.

The values which are being edited change the CSS which styles them and so a refresh is required when changing the values in order to change their styles or else the user does not know for sure if the values have changed or not without refreshing the page. So what I'm trying to do is "redirect" to the current page in order to do the page refresh on updating the editable fields. See attached image.

Could this be because I'm using a view?

vaccinemedia’s picture

Update: simply viewing the node (i.e. normal node view, not a views view) does not trigger the rule when editing fields on the page. The rule is functioning correctly though. Editing the node does trigger the redirect on saving it.

thommyboy’s picture

same here (on D6). to make it more clear what I experience:
- i do have a RADIO set to "editable" in a view
- i have a rule that does display a message if this radio is set to a given value

editing the node the "normal way" does trigger the rule

editing the node via editable fields/ the view is behaving strange- setting the radio does display the ajax animation showing that something is saved but the rule doe not trigger. clicking the SAME radio AGAIN does fire the rule

Sata’s picture

Issue summary: View changes

--disregard, this is meant for editableviews module.

mrweiner’s picture

This issue seems to be present in the current version for D7 when updating an entity reference field on a commerce line item. Changing the value does not trigger my rules that are set to trigger on entity update.

Cayenne’s picture

to #18 and others.
While the update hook seems not to fire when I'm editing from a view, the rule does fire, at least for the entityforms which I am modifying using editablefields in a view.