Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

Import problems with categories

Quote Reply
Import problems with categories
I'm having a strange problem. The categories Import just fine, and using a query, the SQL engine finds them just as you'd expect.

But, during the Link import, I get the following errors:

Quote:
Error: can't find category id for 'Holidays/Fathers Day'
Error: can't find category id for 'Holidays/July 4th'
Error: can't find category id for 'Special Occasions/Missing You'
Error: can't find category id for 'Animals/Animal Zoo'
Error: can't find category id for 'Special Occasions/Missing You'
Error: can't find category id for 'Special Occasions/Say You Are Sorry'
Error: can't find category id for 'Flowers'

(I get about 30 of these errors, some duplicates)

The problem is that the links are not imported to their categories. They all get dumped into category '0'

I've tried all sorts of things with the '_' and spaces, but that doesn't seem to be the problem.

If I take the error message above, and query the Category database:

select * from Category where Name = 'Flowers'

I get the record, so the query is valid... Except where the link is being imported.

Quote Reply
Re: Import problems with categories In reply to
if you can get a hold of your old mysql category links table.. i'd suggest that you go put it back with a different name.. like OLDCategory and either make a script..

contents probably having something like this

Code:
#!/usr/local/bin/perl

use DBI;
#CONNECT

$st1 = $dbh->prepare(qq~SELECT * FROM OLDCategory~);
$st1->execute();
while ($cat = $st1->fetchrow_hashref) {
$st2 = $dbh->do("UPDATE Category SET ID = '${cat}{'ID'}' WHERE Name = '${$cat}{'Name'}' AND ID = '0'");
}

#DISCONNECT

i don't know if that do statement will work like that.. i've never actually built a DO myself Smile just a bunch of prepare executes..

i hope you understand that code.. just remember to repace connect and disconnect Smile

jerry

[This message has been edited by widgetz (edited November 10, 1999).]
Quote Reply
Re: Import problems with categories In reply to
Yep.. there are different workarounds ... and using my old database is one of them.

I'm more concerned WHY this is happening, and trying to get it fixed.

For the first time EVERYTHING worked just the way you'd expect, then this is happening. It's like 90% there....

I mean once the tables are created, the import goes, and everything works ... In the past it had to be tweaked here and there... this was pretty straight forward once I figured out the missing databases.




[This message has been edited by pugdog (edited November 10, 1999).]
Quote Reply
Re: Import problems with categories In reply to
i've had no problems.. but i have no more then 10 categories.. hehe

i'm doing alot of stuff right now.. and i'm making a telnet script to use with hypermart.. well.. a simulator..

jerry
Quote Reply
Re: Import problems with categories In reply to
Actually, I think the easiest way would be to update the Links category in the new Links table with the category from the old one... that hasn't changed... and I've only added about 2 dozen links since the last update.

Quote Reply
Re: Import problems with categories In reply to
Has this problem been solved???

I am incrementally upgrading my Links 2.0 database to Links SQL 1.11 (due to the number of Mods I've installed). I get the same error message as pugdog has indicated:

Code:

Error: can't find category id for 'Cultural Anthro/Regional Studies/Meditteranean'


(This only happens with one category. I tried moving this category to the bottom of the flat file and then changed the ID to another ID number...still get the error.)

I also tried Widgetz's suggestion and I still get the same error.

TIA for any ideas...I did search the forum and this is the only Thread I found that was related. I also looked in pugdog's FAQ site and couldn't find a solution. If there are other Threads, please link them. Thanks!

Regards,


Eliot Lee