Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#16 2011-12-19 14:57:49
- vagari
- Plugin Author
- Registered: 2004-08-25
- Posts: 19
Re: vag_tumblr_import: Import Tumblr posts to your TXP site.
Hi dnwng,
Actually, the double posts would happen using a CRON job too. It’s a bug that appeared a while back and I’m sorry to say that my friend who was the inspiration for this plugin has abandoned posting pretty much anywhere. Thus I haven’t gone back to fix it. I’ll take a look and see what I can find… I know there are now two different APIs and this is built on the first. Lets hope that doesn’t convolute things too much…
Offline
#17 2011-12-19 17:51:12
- vagari
- Plugin Author
- Registered: 2004-08-25
- Posts: 19
Re: vag_tumblr_import: Import Tumblr posts to your TXP site.
dnwng,
Whoops, I wasn’t forward thinking enough and used INT instead of BIGINT for the Tumblr ID column. That’s what was creating the bug. I’ve updated the table creation code in the plugin, but I don’t have time to figure out upgrading current implementations right this second. So if you have a previous install and the table already exists in the database you can simply alter the column to BIGINT UNSIGNED. Sorry about the repeated posts. =/
If anyone has any pointers on code to fix this on an upgrade I’m all ears.
Offline
#18 2011-12-20 00:21:38
- dnwng
- New Member
- Registered: 2011-12-18
- Posts: 3
Re: vag_tumblr_import: Import Tumblr posts to your TXP site.
Hi Vagari,
Thanks for the reply. Unfortunately some problems still persist. Now when I hit refresh, it gives me a little message on the top left that says “from cache” and pulls everything in again. I tried deleting all the posts and then refreshing again but then it doesn’t pull in anything. I have to set it back to INT for it to pull in anything if there is nothing in the textpattern archive.
I tried deleting the plugin and then reinstalling but the same thing happens.
Offline
#19 2011-12-20 15:18:13
- vagari
- Plugin Author
- Registered: 2004-08-25
- Posts: 19
Re: vag_tumblr_import: Import Tumblr posts to your TXP site.
Hi dnwng,
Sorry, that’s a byproduct of the quick fix. I’ve now updated the code to convert the tumblr_ID type while doing the rest of the database tweaking. Lets see if I can be more clear in answering your questions…
1) Caching is fine. We shouldn’t be hammering the tumblr servers with every page load. It’s simply a copy of the latest data pulled in.
2) Everything is pulled in again because even though we’ve modified the tumblr_ID to BIGINT it still doesn’t have the proper ids. It still thinks they’re all new posts. It should be the last time they are imported.
3) The posts don’t come back because now their IDs are properly in the vag_tumblr_import_rel table. The system thinks they’re still there when you refresh. It only checks the plugin’s table.
4) Setting it back to INT only works because the bug is back. It’s not properly inserting the tumblr_ID value any more.
I’d suggest going into MySQL and removing the duplicates from the vag_tumblr_import_rel table, and the textpattern table (you can also upgrade to the latest version, it’ll modify the table on its own). And then next time you do an import it should grab the latest posts, only once.
Sorry for the confusion, my plugin was written a while ago and doesn’t use all the hooks/callbacks that have been implemented. It’s not very good at cleaning up after itself. I guess the next step would be to add a callback to delete the relevant info when a post is removed from within Textpattern.
Offline
#20 2011-12-22 02:39:33
- dnwng
- New Member
- Registered: 2011-12-18
- Posts: 3
Re: vag_tumblr_import: Import Tumblr posts to your TXP site.
Ah, I got it—that makes sense! Thanks for the explanation. I think it’s working now. I have it set to page load and it’s not continually pulling in the same posts so that’s a good sign! Thanks again!
Offline