i just ran into an issue in trying to create a rule where i wanted to perform an action on delete of a node, but the action is conditional on the value of a field in the node that is being deleted. unfortunately, since the event exposed is "after deleting content", the field and its value no longer exist to validate the condition one way or another.

maybe this is not something you can get at, i don't know, but if it were possible to expose a "content about to be deleted" event, you would then be able to evaluate fields in the node before doing an action.

does this make sense?

Comments

fago’s picture

Status: Active » Postponed

It does make sense, but rules just relies on the hooks provided by the node module. As long as there is no such hook, we have no way to do that (in a clean way).

ManyNancy’s picture

Will this be possible in d7?

mitchell’s picture

Title: provide "pre-delete" hook? » Provide "pre-delete" hook
Project: Rules » Drupal core
Version: 6.x-1.0-beta3 » 8.x-dev
Component: Rules Engine » node system
Status: Postponed » Active

Moving this to the core dev branch that is accepting feature requests.

@sziggle: For 6.x and 7.x, I think you'll need to find a workaround solution; for example using a 'trash' flag, and batch deletion on cron. We could discuss this in another support request.

mautumn’s picture

Version: 8.x-dev » 6.x-dev

I think it is very rare to unconditionally delete something. Take orders for example. One would almost certainly want to make sure that the order had not been completed or published - or some other condition/s - before allowing it to be deleted? I'm very surprised this hasn't been requested much more. In my first foray into Rules this was one of the first things I looked for...

Great module BTW.

mitchell’s picture

Version: 6.x-dev » 8.x-dev
bailz777’s picture

I think that this functionality if available would really catch on. I know that I could use it right now. I am using drupal as an interface to connect to multiple api's. each provide a similar service. I want to delete a node based on the return value from the api, but the function to return a value should only be initiated after the user clicks delete. If on the 3rd party side there is an error, I would like to have the option of not completing the delete process.

mitchell’s picture

Component: node system » entity system
Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.