Hi,
I've just put together a module for my company's site that triggers actions when it discovers that a nominated view is empty. I couldn't find anything similar when I was hunting for a way to complete this, so I've written the module myself.
The rationale is that we have a news page and an events page on the site that are Views, and we want to make sure that they remain fresh. The module uses the cron task, and when it discovers that a view is empty (The news page only shows stuff from the last few months and you can choose multiple view/action pairs), it triggers the relevant action. I used cron because the other option is to use the View's 'Empty Text' box with some php, but this risks being fired every time someone looks at the page (multiple times a day).
Is this something that you think is worth submitting as a contributed module? If it is, I'll make an effort to clean it up and submit it.
Cheers,
Tim
Comments
Please evaluate possibility
Please evaluate possibility of joining forces for making it Rules condition. There is idea to make "result of sql query" condition discussed in http://drupal.org/node/521640 and what you describe seems very similar (as Views is actually query builder module)