Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Links::Table::Category new() problem

Quote Reply
Links::Table::Category new() problem
Links::Table::Category::new() executes some queries.
I'm not sure it is a good idea, to execute a query right within the new() creator.
At least before executing the query, should be checked if the column exists.

ExpiryCounted and ExpiryDate are new columns in Links table, was introduced in v2.2.x only,
and the database query fails, if they are not existing...

Best regards,
Webmaster33


Paid Support
from Webmaster33. Expert in Perl programming & Gossamer Threads applications. (click here for prices)
Webmaster33's products (upd.2004.09.26) | Private message | Contact me | Was my post helpful? Donate my help...
Quote Reply
Re: [webmaster33] Links::Table::Category new() problem In reply to
Erm, isn't that what you're meant to do, before calling the "new" option? ;) If the table doesn't exist, then there must be something pretty major going on :P

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Links::Table::Category new() problem In reply to
Quote:
Erm, isn't that what you're meant to do, before calling the "new" option? ;)
Uhm, that's good point, but it seems, that GT missed to check even before the new creator was called...


Quote:
If the table doesn't exist, then there must be something pretty major going on :P
Let's divide my answer into 3 points:
  1. I wrote nothing about any missing table. I wrote: "should be checked if the column exists".

  2. Your point is right, table (or even more the database) existance may be also checked. Probably these database checks may be done, when the script is started. As for mod_perl this check should be done, when script is loaded first.

  3. There is no "any pretty major going" here, as I'm working on a customized LSQL version for my site, and I don't use the ExpiryCounted and ExpiryDate columns.

As a workaround, I had to create these missing columns, even if I don't use them Unimpressed

Best regards,
Webmaster33


Paid Support
from Webmaster33. Expert in Perl programming & Gossamer Threads applications. (click here for prices)
Webmaster33's products (upd.2004.09.26) | Private message | Contact me | Was my post helpful? Donate my help...