Gossamer Forum
Home : Products : DBMan SQL : Development, Plugins and Globals :

post qsearch_results error

Quote Reply
post qsearch_results error
Hi,

I tried to create a POST qsearch_results plugin. After creating it, I installed it without any modifications. I thought this should be working, but it didn't work for me. When I created a PRE qsearch_results plugin, everything worked fine. Could there be something wrong with the plugin module? I get the following error:
Code:
A fatal error has occurred:

Can't use string ("qsearch_results.html") as a HASH ref while "strict refs" in use at /var/www/dbman/cgi-bin/admin//Dbsql/Home.pm line 95.


Please enable debugging in setup for more details.

Stack Trace
======================================
Dbsql (23510): Dbsql::Home::print called at
/var/www/dbman/cgi-bin/admin//Dbsql/Home.pm line 83 with arguments
    (Dbsql::Home=HASH(0x89d19b8), Dbsql::Home=HASH(0x89d19b8), qsearch_results.html).
Dbsql (23510): Dbsql::Home::process called at /var/www/dbman/cgi-bin/db.cgi line 29 with arguments
    (Dbsql::Home=HASH(0x89d19b8), in, GT::CGI=HASH(0x898c9b8), sql, GT::SQL=HASH(0x89d1994), cfg, Dbsql::Config=HASH(0x8931664)).
Dbsql (23510): Apache::ROOTjasper_2einternal_2ebookings_2enl::cgi_2dbin::db_2ecgi::main called at
/var/www/dbman/cgi-bin/db.cgi line 22 with no arguments.
Dbsql (23510): Apache::ROOTjasper_2einternal_2ebookings_2enl::cgi_2dbin::db_2ecgi::handler
called at /usr/lib/perl5/vendor_perl/5.6.1/i386-linux/Apache/Registry.pm line 143 with arguments
    (Apache=SCALAR(0x8391fa8)).
Dbsql (23510): (eval) called at /usr/lib/perl5/vendor_perl/5.6.1/i386-linux/Apache/Registry.pm line 143 with arguments
    (Apache=SCALAR(0x8391fa8)).
Dbsql (23510): Apache::Registry::handler called at /dev/null line 0 with arguments
    (Apache=SCALAR(0x8391fa8)).
Dbsql (23510): (eval) called at /dev/null line 0 with arguments
    (Apache=SCALAR(0x8391fa8)).


System Information
======================================
Perl Version: 5.006001
DBMan SQL Version: 2.1.0
DBI.pm Version: 1.21
Mod Perl Version: 1.26
@INC =
/var/www/dbman/cgi-bin/admin
/var/www/dbman/cgi-bin/admin/
/home/jasper/cvs/tt2_contacts/lib/
/home/jasper/cvs/tt2_contacts/lib/Apache
/usr/lib/perl5/5.6.1/i386-linux
/usr/lib/perl5/5.6.1
/usr/lib/perl5/site_perl/5.6.1/i386-linux
/usr/lib/perl5/site_perl/5.6.1
/usr/lib/perl5/site_perl/5.6.0/i386-linux
/usr/lib/perl5/site_perl/5.6.0
/usr/lib/perl5/site_perl
/usr/lib/perl5/vendor_perl/5.6.1/i386-linux
/usr/lib/perl5/vendor_perl/5.6.1
/usr/lib/perl5/vendor_perl
.
/usr/local/apache/
/usr/local/apache/lib/perl

CGI INPUT
======================================
aff_creditslips.id => 8545
aff_creditslips.id-opt => =
db => aff_creditslips
do => qsearch_results
q => invoices
sid => 04fe5eb55b4648f7ba6171c402db3625


ENVIRONMENT
======================================
DOCUMENT_ROOT => /var/www/dbman/html/
GATEWAY_INTERFACE => CGI-Perl/1.1
HTTP_ACCEPT => text/html, image/png, image/jpeg, image/gif, image/x-xbitmap, */*
HTTP_ACCEPT_CHARSET => iso-8859-1;q=1.0, utf-8;q=1.0, utf-16;q=1.0, iso-8859-1;q=0.6, *;q=0.1
HTTP_ACCEPT_ENCODING => deflate, gzip, x-gzip, identity, *;q=0
HTTP_CACHE_CONTROL => no-cache
HTTP_CONNECTION => Keep-Alive, TE
HTTP_HOST => jasper.internal.bookings.nl:90
HTTP_REFERER => http://jasper.internal.bookings.nl:90/cgi-bin/db.cgi?sid=04fe5eb55b4648f7ba6171c402db3625&&payment_date-null=1&
acceptance_date=!1991-01-01&db=aff_creditslips&do=search_results&sb=creation_date
HTTP_TE => deflate, gzip, chunked, identity, trailers
HTTP_USER_AGENT => Mozilla/5.0 (Linux 2.4.18-3 i686; U) Opera 6.02 [en]
MOD_PERL => mod_perl/1.27
PATH => /bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/usr/bin/X11:/usr/X11R6/bin:/root/bin
PERL_SEND_HEADER => On
QUERY_STRING => db=aff_creditslips&do=qsearch_results&aff_creditslips.id=8545&aff_creditslips.id-opt=%3D&
sid=04fe5eb55b4648f7ba6171c402db3625&q=invoices
REMOTE_ADDR => 192.168.10.132
REMOTE_PORT => 34723
REQUEST_METHOD => GET
REQUEST_URI => /cgi-bin/db.cgi?db=aff_creditslips&do=qsearch_results&aff_creditslips.id=8545&aff_creditslips.id-opt=%3D&
sid=04fe5eb55b4648f7ba6171c402db3625&q=invoices
SCRIPT_FILENAME => /var/www/dbman/cgi-bin/db.cgi
SCRIPT_NAME => /cgi-bin/db.cgi
SERVER_ADDR => 192.168.10.132
SERVER_ADMIN => jasper@bookings.nl
SERVER_NAME => jasper.internal.bookings.nl
SERVER_PORT => 90
SERVER_PROTOCOL => HTTP/1.1
SERVER_SIGNATURE =>
Apache/1.3.24 Server at jasper.internal.bookings.nl Port 90


SERVER_SOFTWARE => Apache/1.3.24 (Unix) mod_perl/1.27

Does anyone have an idea what could be wrong?

Thanks, Jasper


BTW a POST search_results also doesn't seem to work....

http://www.bookings.org
Quote Reply
Re: [jaspercram] post qsearch_results error In reply to
Hi,

Technically, if you create a POST plugin, the hook will be executed after running the function code. Hence, you have to return a hash which contains a template name and an option hash in your plugin like other functions of Dbsql ...

i.e

sub GeneratePDF {
my ($args) = @_;
# Do something useful here

return ('search_results.html',{
header => 'something',
msg => 'this is a POST plugin'
});
}
Cheers,
Jean
Gossamer Threads, Inc.
Quote Reply
Re: [jean] post qsearch_results error In reply to
Hi,

To reduce confusion (and make the empty plugins that are created by the wizard functional), I would suggest the default POST plugin that is created by the wizard would look something like this:
Code:
sub YourFunc {
my( $home, $tmpl_name, @args ) = @_

#do something useful here

return( $tmpl_name, @args );
}
If I am correct, this plugin would do nothing, but it would not break the code.

Jasper

http://www.bookings.org