The title is quite self-explaining. I'd like to add some thoughts, though:

A very common use-case for me is to create a View with bulk operations (VBO) that returns a list of users, nodes, whatever, which will then be used as an input for a rule for setting fields of the entity in question. The problem with this is, I have to fire the rule on a certain event or schedule it, for it to be put in action. Many times I just pick "profile is shown" or similar, because this happens quite often. The rule will thus be executed randomly.

What I'd better want to do is, fire a rule when a certain View is rebuild, i.e. when it's result isn't fetched from the cache.

For example, I have a user ranking page ("Hall of Fame") sorting the users after certain criteria. This page is cached and will be rendered once per day or so (depending on the settings of the view). The user rank shall be transfered to the profile of each user exactly then the cache of the Hall of Fame flushes, so both (fields and view) are always in perfect sync. This may happen any time a user gets on the profile page and would cause trouble on traffic peaks etc.

This feature request could be used for a discussion and to find out, if other Rules addicts need this feature, too.

Comments

tr’s picture

Title: Fire a Rules compontent when a View result refreshes » Event: View is rebuilt
Version: 7.x-2.x-dev » 8.x-3.x-dev
Issue summary: View changes

This sounds pretty easy to do, perhaps with:
https://api.drupal.org/api/views/views.api.php/function/hook_views_inval...
https://api.drupal.org/api/drupal/core%21modules%21views%21views.api.php...

If this feature is important to you, I suggest you provide a patch with a test.

I'm moving this to 8.x-3.x because we're not really adding new features to D7 any more.

tr’s picture

Status: Active » Postponed

The maintainers are not working on this. If you would like to see this feature, please provide a patch with tests.