Wednesday, April 21, 2010

Delete Plugin "Gotcha"

Today I discovered a nice "gotcha" moment when trying to delete a custom entity record.  This is the error I was seeing:

After trying to use a debugger to step into the delete plugin and failing miserably, I finally discovered that the plugin had an image that was not being used.  Once I removed the image and re-registered the plugin, it triggered successfully. 

Further testing revealed that anytime you register a post image with a delete plugin then your plugin will not even trigger and throw the error shown above.  This makes complete sense because the record will not have a post image as it will be deleted.

No comments:

Post a Comment