Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2011-12-20 16:28:01

vagari
Plugin Author
Registered: 2004-08-25
Posts: 19

Callback on article delete

I have a plugin that pulls in posts from a third party. On import the post is added to the Texpattern database and I add a record to my separate table matching up the Textpattern ID with the post’s ID from the outside site to prevent duplicates.

A bug that cropped up recently from my shortsightedness (third party’s post IDs are getting long) caused articles to be imported repeatedly. I fixed that issue, but now I’m trying to come up with a solution for cleaning up my plugin’s table when articles are deleted from the Textpattern table. I assumed I could use a callback to the post being deleted and simply delete it from my table. But I can’t locate any references to it. Am I really going to have to search through my table and remove all my references “manually” on the plugin’s admin page or something?

On the flip side. Perhaps this is a bad idea. It may need some more pondering. If I remove references to imported articles, and then the post is deleted from Textpattern, if it’s still in the feed it’ll get re-imported. That may not be what the user wants outside of this edge case where a bug was involved.

Any thoughts? Thanks in advance!

Last edited by vagari (2011-12-20 16:30:35)

Offline

Board footer

Powered by FluxBB