Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I'm trying to run some code on the Media.AfterDelete event but I can't access the media properties as their all null when in the recycle bin (I presume as it has the IsTrashed flag set to true)
I've tried creating a new Media item from the ID being passed in from the recycle bin, but this doesn't work either.
I could use the Media.AfterMoveToTrash, but this would mean the code would run when its moved in the Recycle bin, but the user could then restore the item back into the media section (which is not what i want)
Any ideas ?
Moved my code into the Media.BeforeDelete event and this is now working fine.
I dont think you will be able to do this throught the API for the resons described above. Either you would have to write some SQL or a custom stored proc to retirve the data. Prehaps you could store the media data in a custom table with a lookup so when the media is deleted you can call a sql script that can look up the media data in your custom table?
Let me know what you come up with :)
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted