Gossamer Forum
Quote Reply
Documentation Error:
Alex,

A typo in the docs for plugins:

Code:
Examples
1. Your install needs to add a custom column named 'Review' to
the Links Table To do this we will need a GT::SQL::Editor object.

my $editor = $DB->table ('Links');
unless ($editor->add_col ( 'Review', { type => 'TEXT' }) {
$Plugins::Pluginname::error = "Unable to add column to Links: $GT::SQL::error";
return;
}
Note the missing ')' in the 'unless' line.

Also, wouldn't a better example be something like:

Code:
my $table = $DB->table('Links');
my %cols = $table->cols;
if (!(exists $cols{'Review'})) {
my $editor = $DB->editor('Links');
unless ($editor->add_col ( 'Review', { type => 'TEXT' }) ) {
$Plugins::Pluginname::error = "Unable to add column to Links: $GT::SQL::error";
return;
}
} else {
$Plugins::Pluginname::error = "Unable to add column to Links, column already exists";
}
PUGDOGŪ Enterprises, Inc.
FAQ:http://LinkSQL.com/FAQ
Forum:http://LinkSQL.com/forum
Subject Author Views Date
Thread Documentation Error: pugdog 2578 Feb 27, 2001, 9:58 PM
Post Re: Documentation Error:
Paul 2471 Feb 28, 2001, 4:53 AM
Thread Re: Documentation Error:
Alex 2490 Feb 28, 2001, 11:47 AM
Post Re: Documentation Error:
pugdog 2472 Feb 28, 2001, 5:57 PM