Thread: [Yams-discuss] Search feature
Brought to you by:
modred
From: Gaelyne G. <ga...@vi...> - 2000-03-11 09:35:31
|
G'day, I was able to install the new version OK, but have run into a problem with the search feature. Here's what the Error log has to say about it (I stripped the path lines for this). cart.pl: Use of uninitialized value at ... Yams4/Cart.pm line 1894. malformed header from script. Bad header=<FORM METHOD="POST" ACTION="/c: ... cart.pl unable to include "cart.pl?action=print_search" in parsed file /commerce/shop/test.html The middle one is curious. It almost looks like an MS-DOS path. I couldn't find it in any of the .pm or .pl files. It has to be there somewhere. The update required a few more files to be changed than what was listed in the Upgrade text file, by the way. For completeness, and in trying to find the solution for this, I copied over the entire set of .pl and .pm files and made the appropriate changes to the files for location. (Yams:: to Yams4::). The related items change worked fine, at least as far as the admin pages go - I haven't found how this is displayed just yet though. Cheers, Gaelyne //\ /\\ Gaelyne R. Gasson ga...@vi... || * \ . . / * || 90 Hilliers Rd Phone: +61 8 8322-2716 \\____\X/____// Reynella, S.A. 5161 Fax: +61 8 8387-5810 / * /O\ * \ Australia ICQ: 5069384 \__/ " \__/ http://videocam.net.au http://vcsweb.com C64/128 Support * Web Hosting * Web Design |
From: Gaelyne G. <ga...@vi...> - 2000-03-14 02:53:16
|
G'day Pat, > Gaelyne, > what is you $shop_script_root set to in YamsGlobals.pm? /cgi-bin/commerce4/shop/ The directory with the perl .pm files is Yams4, so I use "commerce4" as the directory name so I can differentiate between the versions I've been testing. > >From: Gaelyne Gasson <ga...@vi...> > >To: yam...@li... > >Subject: [Yams-discuss] Search feature > >Date: Sat, 11 Mar 2000 20:00:50 +1030 (CST) > > > >G'day, > > > >I was able to install the new version OK, but have run into a problem with > >the search feature. Here's what the Error log has to say about it (I > >stripped the path lines for this). > > > > cart.pl: Use of uninitialized value at ... Yams4/Cart.pm line > 1894. > > malformed header from script. Bad header=<FORM METHOD="POST" > > >ACTION="/c: ... cart.pl > > unable to include "cart.pl?action=print_search" in parsed file > > >/commerce/shop/test.html > > > >The middle one is curious. It almost looks like an MS-DOS path. > >I couldn't find it in any of the .pm or .pl files. It has to be >there > >somewhere. > > > >The update required a few more files to be changed than what was >listed in > >the Upgrade text file, by the way. > > > >For completeness, and in trying to find the solution for this, I >copied > >over the entire set of .pl and .pm files and made the >appropriate changes > >to the files for location. (Yams:: to Yams4::). > > > >The related items change worked fine, at least as far as the admin >pages > >go - I haven't found how this is displayed just yet though. Cheers, Gaelyne //\ /\\ Gaelyne R. Gasson ga...@vi... || * \ . . / * || 90 Hilliers Rd Phone: +61 8 8322-2716 \\____\X/____// Reynella, S.A. 5161 Fax: +61 8 8387-5810 / * /O\ * \ Australia ICQ: 5069384 \__/ " \__/ http://cbm.videocam.net.au |
From: Derek C. <der...@ma...> - 2000-03-14 17:11:54
|
I just tried testing out the new version and have the same problem. In addition, the listings on the homepage before login of the departments and such no longer display. But, I haven't looked at the error log for these yet. But, I get this same c: error. Derek Carr Gaelyne Gasson wrote: > > G'day Pat, > > > Gaelyne, > > what is you $shop_script_root set to in YamsGlobals.pm? > > /cgi-bin/commerce4/shop/ > > The directory with the perl .pm files is Yams4, so I use "commerce4" as > the directory name so I can differentiate between the versions I've been > testing. > > > >From: Gaelyne Gasson <ga...@vi...> > > >To: yam...@li... > > >Subject: [Yams-discuss] Search feature > > >Date: Sat, 11 Mar 2000 20:00:50 +1030 (CST) > > > > > >G'day, > > > > > >I was able to install the new version OK, but have run into a problem with > > >the search feature. Here's what the Error log has to say about it (I > > >stripped the path lines for this). > > > > > > cart.pl: Use of uninitialized value at ... Yams4/Cart.pm line > 1894. > > > malformed header from script. Bad header=<FORM METHOD="POST" > > > >ACTION="/c: ... cart.pl > > > unable to include "cart.pl?action=print_search" in parsed file > > > >/commerce/shop/test.html > > > > > >The middle one is curious. It almost looks like an MS-DOS path. > > >I couldn't find it in any of the .pm or .pl files. It has to be >there > > >somewhere. > > > > > >The update required a few more files to be changed than what was >listed in > > >the Upgrade text file, by the way. > > > > > >For completeness, and in trying to find the solution for this, I >copied > > >over the entire set of .pl and .pm files and made the >appropriate changes > > >to the files for location. (Yams:: to Yams4::). > > > > > >The related items change worked fine, at least as far as the admin >pages > > >go - I haven't found how this is displayed just yet though. > > Cheers, > Gaelyne > > //\ /\\ Gaelyne R. Gasson ga...@vi... > || * \ . . / * || 90 Hilliers Rd Phone: +61 8 8322-2716 > \\____\X/____// Reynella, S.A. 5161 Fax: +61 8 8387-5810 > / * /O\ * \ Australia ICQ: 5069384 > \__/ " \__/ http://cbm.videocam.net.au > > _______________________________________________ > Yams-discuss mailing list > Yam...@li... > http://lists.sourceforge.net/mailman/listinfo/yams-discuss |
From: Garth S. <ga...@ap...> - 2000-03-14 17:27:23
|
For the first problem add a space to the beginning of the the string in lines 980, 984, and 1138. As for the second I'll have to find a clean box to try and install it on. Is the problem with search when you try to display the form or when you try to get results from the form? Garth On Tue, 14 Mar 2000, Derek Carr wrote: > I just tried testing out the new version and have the same problem. In > addition, the listings on the homepage before login of the departments > and such no longer display. But, I haven't looked at the error log for > these yet. But, I get this same c: error. > > Derek Carr > > Gaelyne Gasson wrote: > > > > G'day Pat, > > > > > Gaelyne, > > > what is you $shop_script_root set to in YamsGlobals.pm? > > > > /cgi-bin/commerce4/shop/ > > > > The directory with the perl .pm files is Yams4, so I use "commerce4" as > > the directory name so I can differentiate between the versions I've been > > testing. > > > > > >From: Gaelyne Gasson <ga...@vi...> > > > >To: yam...@li... > > > >Subject: [Yams-discuss] Search feature > > > >Date: Sat, 11 Mar 2000 20:00:50 +1030 (CST) > > > > > > > >G'day, > > > > > > > >I was able to install the new version OK, but have run into a problem with > > > >the search feature. Here's what the Error log has to say about it (I > > > >stripped the path lines for this). > > > > > > > > cart.pl: Use of uninitialized value at ... Yams4/Cart.pm line > 1894. > > > > malformed header from script. Bad header=<FORM METHOD="POST" > > > > >ACTION="/c: ... cart.pl > > > > unable to include "cart.pl?action=print_search" in parsed file > > > > >/commerce/shop/test.html > > > > > > > >The middle one is curious. It almost looks like an MS-DOS path. > > > >I couldn't find it in any of the .pm or .pl files. It has to be >there > > > >somewhere. > > > > > > > >The update required a few more files to be changed than what was >listed in > > > >the Upgrade text file, by the way. > > > > > > > >For completeness, and in trying to find the solution for this, I >copied > > > >over the entire set of .pl and .pm files and made the >appropriate changes > > > >to the files for location. (Yams:: to Yams4::). > > > > > > > >The related items change worked fine, at least as far as the admin >pages > > > >go - I haven't found how this is displayed just yet though. > > > > Cheers, > > Gaelyne > > > > //\ /\\ Gaelyne R. Gasson ga...@vi... > > || * \ . . / * || 90 Hilliers Rd Phone: +61 8 8322-2716 > > \\____\X/____// Reynella, S.A. 5161 Fax: +61 8 8387-5810 > > / * /O\ * \ Australia ICQ: 5069384 > > \__/ " \__/ http://cbm.videocam.net.au > > > > _______________________________________________ > > Yams-discuss mailing list > > Yam...@li... > > http://lists.sourceforge.net/mailman/listinfo/yams-discuss > > _______________________________________________ > Yams-discuss mailing list > Yam...@li... > http://lists.sourceforge.net/mailman/listinfo/yams-discuss > |
From: Derek C. <der...@ma...> - 2000-03-14 20:51:36
|
I'm sorry, what file should I put the spaces in? The search problem pops up when you try to display the form. Derek Garth Sainio wrote: > > For the first problem add a space to the beginning of the the string in > lines 980, 984, and 1138. > > As for the second I'll have to find a clean box to try and install it on. > > Is the problem with search when you try to display the form or when you > try to get results from the form? > > Garth > > On Tue, 14 Mar 2000, Derek Carr wrote: > > > I just tried testing out the new version and have the same problem. In > > addition, the listings on the homepage before login of the departments > > and such no longer display. But, I haven't looked at the error log for > > these yet. But, I get this same c: error. > > > > Derek Carr > > > > > > _______________________________________________ > > Yams-discuss mailing list > > Yam...@li... > > http://lists.sourceforge.net/mailman/listinfo/yams-discuss > > > > _______________________________________________ > Yams-discuss mailing list > Yam...@li... > http://lists.sourceforge.net/mailman/listinfo/yams-discuss |
From: Garth S. <ga...@ap...> - 2000-03-15 12:11:13
|
The second problem may be related to the fact that I use the environment variable HTTP_REFERER in the creation of the session_id, so if you go to the page directly then that value is not available - that explains the use of initialized variable at Cart.pm line 1894 error. But that really shouldn't be causing the the malformed header error (which I couldn't recreate on my box at home, so it may have something to do with the way apache is configured). To fix the use of the unitialized value, change line 1893 from my($http_ref) = $ENV{'HTTP_REFERER'}; to my($http_ref) = $ENV{'HTTP_REFERER'} || ""; Are you using any other includes in the page with the include for the search form? Do they work? Is it running as a cgi script or as an Apache::Registry script? Are you using the latest version of cart.pl? As a short term solution, the following HTML code should create the desired form (with the updated path to the cart.pl script): <FORM METHOD="POST" ACTION="/registry/commerce/shop/cart.pl" ENCTYPE="application/x-www-form-urlencoded"> <INPUT TYPE="text" NAME="search_terms" SIZE=15 MAXLENGTH=50> <SELECT NAME="where"> <OPTION VALUE="Name">Name <OPTION VALUE="Description">Description </SELECT> <INPUT TYPE="hidden" NAME="action" VALUE="search"> <INPUT TYPE="submit"> </FORM> Garth On Tue, 14 Mar 2000, Derek Carr wrote: > I'm sorry, what file should I put the spaces in? > > The search problem pops up when you try to display the form. > > Derek > > > Garth Sainio wrote: > > > > For the first problem add a space to the beginning of the the string in > > lines 980, 984, and 1138. > > > > As for the second I'll have to find a clean box to try and install it on. > > > > Is the problem with search when you try to display the form or when you > > try to get results from the form? > > > > Garth > > > > On Tue, 14 Mar 2000, Derek Carr wrote: > > > > > I just tried testing out the new version and have the same problem. In > > > addition, the listings on the homepage before login of the departments > > > and such no longer display. But, I haven't looked at the error log for > > > these yet. But, I get this same c: error. > > > > > > Derek Carr > > > > > > > > > _______________________________________________ > > > Yams-discuss mailing list > > > Yam...@li... > > > http://lists.sourceforge.net/mailman/listinfo/yams-discuss > > > > > > > _______________________________________________ > > Yams-discuss mailing list > > Yam...@li... > > http://lists.sourceforge.net/mailman/listinfo/yams-discuss > > _______________________________________________ > Yams-discuss mailing list > Yam...@li... > http://lists.sourceforge.net/mailman/listinfo/yams-discuss > |
From: Gaelyne G. <ga...@vi...> - 2000-03-15 13:33:25
|
G'day All, Special note to Pat - I have your answers in this mail as well. On Mar 15 2000 Garth Sainio <ga...@ap...> wrote: > The second problem may be related to the fact that I use the environment > variable HTTP_REFERER in the creation of the session_id, so if you go to > the page directly then that value is not available - that explains the > use of initialized variable at Cart.pm line 1894 error. But that really > shouldn't be causing the the malformed header error (which I couldn't > recreate on my box at home, so it may have something to do with the way > apache is configured). > > To fix the use of the unitialized value, change line 1893 from > > my($http_ref) = $ENV{'HTTP_REFERER'}; > > to > > my($http_ref) = $ENV{'HTTP_REFERER'} || ""; I made this change, and it changed the error log info (included below), but it still resulted in Apache reporting an error in completing the directive on the web page. > Are you using any other includes in the page with the include for the > search form? > Do they work? Yes, I'm using an include for header and footer on the index page. These work fine. I tried adding in the toplevel.pl?type=department include, but this resulted in another "error processing this directive" from Apache. To further test, I have a cgi-bin perl script that displays random text and is an include. I tried it on the shop page as both: <!--#include virtual="blah" --> and <!--#exec cgi="blah"--> and it worked OK both times. Feeling experimental, I changed the Yams include statements to <!--#exec cgi=".."--> and had the "error processing this directive" error from Apache. It was worth a try. > Is it running as a cgi script or as an Apache::Registry script? cgi script. > Are you using the latest version of cart.pl? Yes. Pat asked me to try cart.pl from the command line and report the results. Here it is - this is the result **AFTER** changing line 1893: ---------------------------- [shop] # cart.pl (offline mode: enter name=value pairs on standard input) action=print_search <FORM METHOD="POST" ACTION="/cgi-bin/commerce4/shop/cart.pl" ENCTYPE="application/x-www-form-urlencoded"> <INPUT TYPE="text" NAME="search_terms" SIZE=15 MAXLENGTH=50><SELECT NAME="where"> <OPTION VALUE="Name">Name <OPTION VALUE="Description">Description </SELECT> <INPUT TYPE="submit" NAME=".submit"><INPUT TYPE="hidden" NAME="action" VALUE="search"><INPUT TYPE="hidden" NAME="session_id" VALUE="8O69g43o0cuU0lWfxnnNRgJp"></FORM>Wed Mar 15 23:12:10 [shop] # ---------------------------- Here's the log file result **AFTER** changing line 1893, and I've included the toplevel.pl one for measure. This isn't an option that I normally use though. [error] malformed header from script. Bad header=<FORM METHOD="POST" ACTION="/c: /cgi-bin/commerce4/shop/cart.pl [error] unable to include "/cgi-bin/commerce4/shop/cart.pl?action=print_search" in parsed file /commerce/shop/index.html toplevel.pl: Use of uninitialized value at (eval 14) line 27. [error] malformed header from script. Bad header=<H2>Choose Department</H2><FOR: /cgi-bin/commerce4/shop/toplevel.pl [error] unable to include "/cgi-bin/commerce4/shop/toplevel.pl?type=department" in parsed file /commerce/shop/index.html > As a short term solution, the following HTML code should create the > desired form (with the updated path to the cart.pl script): > > <FORM METHOD="POST" ACTION="/registry/commerce/shop/cart.pl" > ENCTYPE="application/x-www-form-urlencoded"> > <INPUT TYPE="text" NAME="search_terms" SIZE=15 MAXLENGTH=50> > <SELECT NAME="where"> > <OPTION VALUE="Name">Name > <OPTION VALUE="Description">Description > </SELECT> > <INPUT TYPE="hidden" NAME="action" VALUE="search"> > <INPUT TYPE="submit"> > </FORM> Thanks, Garth. This DOES work for the item name. Which description is it using? I tried a couple of tests for the description using words that are in the shop item descriptions but each time it didn't come up with a match when it should have. Cheers, Gaelyne |
From: Garth S. <ga...@ap...> - 2000-03-15 13:45:30
|
On Wed, 15 Mar 2000, Gaelyne Gasson wrote: > Yes, I'm using an include for header and footer on the index page. These > work fine. I tried adding in the toplevel.pl?type=department include, but > this resulted in another "error processing this directive" from Apache. > > To further test, I have a cgi-bin perl script that displays random text > and is an include. I tried it on the shop page as both: > <!--#include virtual="blah" --> and <!--#exec cgi="blah"--> and it worked > OK both times. Feeling experimental, I changed the Yams include > statements to <!--#exec cgi=".."--> and had the "error processing this > directive" error from Apache. It was worth a try. > > > > Is it running as a cgi script or as an Apache::Registry script? > > cgi script. > > > Are you using the latest version of cart.pl? > > Yes. > > Pat asked me to try cart.pl from the command line and report the > results. Here it is - this is the result **AFTER** changing line 1893: > > ---------------------------- > [shop] # cart.pl > (offline mode: enter name=value pairs on standard input) > action=print_search > <FORM METHOD="POST" ACTION="/cgi-bin/commerce4/shop/cart.pl" ENCTYPE="application/x-www-form-urlencoded"> > <INPUT TYPE="text" NAME="search_terms" SIZE=15 MAXLENGTH=50><SELECT NAME="where"> > <OPTION VALUE="Name">Name > <OPTION VALUE="Description">Description > </SELECT> > <INPUT TYPE="submit" NAME=".submit"><INPUT TYPE="hidden" NAME="action" VALUE="search"><INPUT TYPE="hidden" NAME="session_id" VALUE="8O69g43o0cuU0lWfxnnNRgJp"></FORM>Wed Mar 15 23:12:10 > [shop] # > ---------------------------- > > Here's the log file result **AFTER** changing line 1893, and I've > included the toplevel.pl one for measure. This isn't an option that I > normally use though. > > [error] malformed header from script. Bad header=<FORM METHOD="POST" ACTION="/c: /cgi-bin/commerce4/shop/cart.pl > [error] unable to include "/cgi-bin/commerce4/shop/cart.pl?action=print_search" in parsed file /commerce/shop/index.html > toplevel.pl: Use of uninitialized value at (eval 14) line 27. > [error] malformed header from script. Bad header=<H2>Choose Department</H2><FOR: /cgi-bin/commerce4/shop/toplevel.pl > [error] unable to include "/cgi-bin/commerce4/shop/toplevel.pl?type=department" in parsed file /commerce/shop/index.html It looks like apache is expecting the header from the script. Do the includes that work print $CGI->header (or its equivalent)? On my system if I print out the $CGI->header in the includes, I get multiple headers left in the html page - your setup may need to print the header to allow the includes to added to file. > > > > As a short term solution, the following HTML code should create the > > desired form (with the updated path to the cart.pl script): > > > > <FORM METHOD="POST" ACTION="/registry/commerce/shop/cart.pl" > > ENCTYPE="application/x-www-form-urlencoded"> > > <INPUT TYPE="text" NAME="search_terms" SIZE=15 MAXLENGTH=50> > > <SELECT NAME="where"> > > <OPTION VALUE="Name">Name > > <OPTION VALUE="Description">Description > > </SELECT> > > <INPUT TYPE="hidden" NAME="action" VALUE="search"> > > <INPUT TYPE="submit"> > > </FORM> > > Thanks, Garth. This DOES work for the item name. Which description is it > using? I tried a couple of tests for the description using words that are > in the shop item descriptions but each time it didn't come up with a match > when it should have. Doh. This was not a good release for me. The table that is used for searching descriptions needs to be backfilled for existing products. The following script should take care of that. #!/usr/bin/perl -w # quick script to populate the product_description_search table use strict; use Yams::DBWrap; use Yams::YamsGlobals; my($DBH) = &dbconnect(\%config); my($sql, $sth); $sql = "SELECT sku, short_description, long_description, other_text FROM products"; my($sku, $short_description, $long_description, $other_text); $sth = &dbsql($DBH, $sql); while(($sku, $short_description, $long_description, $other_text) = $sth->fetchrow_array) { my($description) = lc($short_description) . "\n" . lc($long_description) . "\n" . lc($other_text); $description = $DBH->quote($description); my($q_sku) = $DBH->quote($sku); $sql = "INSERT INTO product_description_search VALUES($q_sku, $description)"; my($sth2) = &dbsql($DBH, $sql); $sth2->finish if($sth2); } $sth->finish if($sth); $DBH->disconnect; Garth > > > Cheers, > Gaelyne > > > |
From: Gaelyne G. <ga...@vi...> - 2000-03-16 03:50:13
|
On Mar 15 2000 Garth Sainio <ga...@ap...> wrote: > > [error] malformed header from script. Bad header=<FORM METHOD="POST" ACTION="/c: /cgi-bin/commerce4/shop/cart.pl > > [error] unable to include "/cgi-bin/commerce4/shop/cart.pl?action=print_search" in parsed file /commerce/shop/index.html > > toplevel.pl: Use of uninitialized value at (eval 14) line 27. > > [error] malformed header from script. Bad header=<H2>Choose Department</H2><FOR: /cgi-bin/commerce4/shop/toplevel.pl > > [error] unable to include "/cgi-bin/commerce4/shop/toplevel.pl?type=department" in parsed file /commerce/shop/index.html > > It looks like apache is expecting the header from the script. It does. > Do the includes that work print $CGI->header (or its equivalent)? Yes. In fact, in order to have a "view shopping cart" link work, I needed to add the $CGI->header line to the show_cart subroutine. (I was meaning to mention this to you). Speaking of $CGI->header, I'm not as familiar with this format for Perl commands. Is there a resource where I can learn more about them? > On my system if I print out the $CGI->header in the includes, I get > multiple headers left in the html page - your setup may need to print > the header to allow the includes to added to file. From what I can tell, it's not required for some items and is for others. Such as the show_cart page when used as a link and the includes. I experimented and added: print $CGI->header, $CGI->start_html; to the line above the print &getSearchFormString,($CGI, $DBH); string and the virtual include worked fine. Success! I also tried it in the toplevel.pl file for the ?type=department include, adding print $CGI->header, $CGI->start_html; to the line above the print &printTopLevels line and it too worked. > > > As a short term solution, the following HTML code should create the > > > desired form (with the updated path to the cart.pl script): > > > > > > <FORM METHOD="POST" ACTION="/registry/commerce/shop/cart.pl" snip > > Thanks, Garth. This DOES work for the item name. Which description is it > > using? I tried a couple of tests for the description using words that are > > in the shop item descriptions but each time it didn't come up with a match > > when it should have. > > Doh. This was not a good release for me. The table that is used for > searching descriptions needs to be backfilled for existing products. > > The following script should take care of that. It did. Thanks! Cheers, Gaelyne |