"create new content" blank nodes - help!

I am using "create new content" so that I can save a special node ref from the "current content" to another content type that exists on the system. I hope that this is the best way of writing nodes for any other content type outside of the current "created content"!

This is what I do:
1) I do an action to create "new content" assigned to my other content type;
2) I populate - or leave blank - this new content node (populate field), but I populate it with data only if certain checks are true on "current content". If they are not, then I do not populate the node and do not need this new node to be created.
3) I need to save only a filled new content node and get rid of it if it is blank.

This is the core of my problem! I can't find any way to terminate node creation and always end up with a blank node and no way to delete it before the Rules are done executing. How can I avoid adding a blank node? Is there a way to terminate "new content" node creation within my rule if the node is blank?

I had a ton of these blank nodes, then added a PHP action as the last action in this Rule - db_query looking for all blanks of this content type and then node_delete to get rid of them. But now, it would delete every previous blank, but leave the last one (node creation does not happen until all Rules run and this node officially does not exist yet at the time node_delete runs?????).
It would be much better not to load the db with this query, since it still leaves the last node, but have some way of terminating "new content" node creation if it is blank. How? Any ideas? Thank you!

Comments

Run conditions first?

Itangalo's picture

Once you run the action to create a new node, there will be one queued up for creation – and I don't know any reasonable way of stopping this.

What you could do instead is to run the condition checks first (for populating the node), and if any of them return TRUE then you create the node and start populating it.

Makes sense?

//Johan Falk
**
Check out NodeOne's Drupal Learning Library! 250+ screencasts and exercises, for Drupal introduction, advanced configuration, and coding. Creative Commons license!

Check out Skill Compass – an experiment for Drupal learning.

Rules

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

Hot content this week