Hi,
the plugin worked fine in 2.0.0 but is not working as fine in Version 2.0.2. This is preventing easy upgrades.
First Issue: File System structure has changed
In Version 2.0.2 plugins are in admin/Plugins/DBsql (before it was admin/Plugins). When you upgrade an existing installation the Plugin Manager is not any longer finding the Plugins already installed.
Workaround:
1. You need to reinstall the distributed tar file.
2. You need to insert ::DBsql in any function call (e.g. hook install and uninstall sections etc.) of the Plugin Files.
3. If applicable you need to change your functions calls in your templates and add ::DBsql
Second Issue:
I found it easier to rebuild the plugin using the wizzard. But it has at least one bug with the new file system structure. The install.pm is inserting wrong hook calls (the ::DBsql is missing).
Workaround: patch those calls to $mgr->install_hooks and $mgr->uninstall_hook by inserting the missing ::DBsql
Third Issue:
After Processing the plugin DBsql ist sarching a template named "1". I don't know where that Problem is located. It might be the Plugin itself, because the GT XML sample plugin does not have this problem.
Workaround: Provide an empty file name "1" in the templates directory.
For reference here is the plugin code. It is hooked to home. So you can call it with db.cgi?do=home&page=the/page/to/show.html&db=yourdb. The html file needs to be in the template directory.
# -------------------------------------------------------------------
# This subroutine will get called whenever the hook 'home'
# is run. You should call GT::Plugins->action ( STOP ) if you don't
# want the regular code to run, otherwise the code will continue as
# normal.
#
my ($args) = @_;
# Do something useful here
my $file = $args->{cgi}->{page} || '' ;
$file or return $args;
#check if user passed on some tricks in filename
unless ($file =~ m,^([-\w. \/]+)$, and $file !~ m,\.\.,) {
return $args->error("Invalid page $file");
}
# you can add some vars and return to the template here, good luck
$args->print ($file,{});
GT::Plugins->action ( STOP );
}
Any Help would be appriciated!
Thanks
the plugin worked fine in 2.0.0 but is not working as fine in Version 2.0.2. This is preventing easy upgrades.
First Issue: File System structure has changed
In Version 2.0.2 plugins are in admin/Plugins/DBsql (before it was admin/Plugins). When you upgrade an existing installation the Plugin Manager is not any longer finding the Plugins already installed.
Workaround:
1. You need to reinstall the distributed tar file.
2. You need to insert ::DBsql in any function call (e.g. hook install and uninstall sections etc.) of the Plugin Files.
3. If applicable you need to change your functions calls in your templates and add ::DBsql
Second Issue:
I found it easier to rebuild the plugin using the wizzard. But it has at least one bug with the new file system structure. The install.pm is inserting wrong hook calls (the ::DBsql is missing).
Workaround: patch those calls to $mgr->install_hooks and $mgr->uninstall_hook by inserting the missing ::DBsql
Third Issue:
After Processing the plugin DBsql ist sarching a template named "1". I don't know where that Problem is located. It might be the Plugin itself, because the GT XML sample plugin does not have this problem.
Workaround: Provide an empty file name "1" in the templates directory.
For reference here is the plugin code. It is hooked to home. So you can call it with db.cgi?do=home&page=the/page/to/show.html&db=yourdb. The html file needs to be in the template directory.
Code:
sub page { # -------------------------------------------------------------------
# This subroutine will get called whenever the hook 'home'
# is run. You should call GT::Plugins->action ( STOP ) if you don't
# want the regular code to run, otherwise the code will continue as
# normal.
#
my ($args) = @_;
# Do something useful here
my $file = $args->{cgi}->{page} || '' ;
$file or return $args;
#check if user passed on some tricks in filename
unless ($file =~ m,^([-\w. \/]+)$, and $file !~ m,\.\.,) {
return $args->error("Invalid page $file");
}
# you can add some vars and return to the template here, good luck
$args->print ($file,{});
GT::Plugins->action ( STOP );
}
Any Help would be appriciated!
Thanks