From f420103b2edcd4a163e99223e5bb71544f3932ac Mon Sep 17 00:00:00 2001 From: JT Smith Date: Mon, 24 Jul 2006 20:00:53 +0000 Subject: [PATCH] - fix: Shopping Cart Not Working - fix: Editing Products Template wipes out SKU - fix: Email to RFE List Going to Spam - fix: 7.0.0-7.0.1 upgrade -- op called w/o passing session - fix: spectre.pl daemon error - Changed the Spectre tests to be a seperate option on the spectre.pl command line, which fixed a problem with the WRE monitor, and also enabled us to add more complete connectivity testing. --- docs/changelog/7.x.x.txt | 8 +++++++ lib/Spectre/Admin.pm | 29 ++++++++++++++------------ lib/WebGUI/Commerce/ShoppingCart.pm | 3 +-- lib/WebGUI/Operation/Commerce.pm | 2 +- lib/WebGUI/Operation/ProductManager.pm | 2 +- lib/WebGUI/Operation/Spectre.pm | 8 +++---- sbin/spectre.pl | 11 ++++++++-- 7 files changed, 40 insertions(+), 23 deletions(-) diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 0e3000df7..c32a4569b 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -26,6 +26,14 @@ - Made some improvements to the mail subsystems. - fix: Revised WebGUI::HTML::filter "all" so that text does not run together when tags are removed. Added additional tests to HTML.t. (Eric Kennedy) + - fix: Shopping Cart Not Working + - fix: Editing Products Template wipes out SKU + - fix: Email to RFE List Going to Spam + - fix: 7.0.0-7.0.1 upgrade -- op called w/o passing session + - fix: spectre.pl daemon error + - Changed the Spectre tests to be a seperate option on the spectre.pl command + line, which fixed a problem with the WRE monitor, and also enabled us to + add more complete connectivity testing. - fix: Templates XHTML compliance (Wouter van Oijen / ProcoliX) diff --git a/lib/Spectre/Admin.pm b/lib/Spectre/Admin.pm index d7fd978f4..8b14cdd79 100644 --- a/lib/Spectre/Admin.pm +++ b/lib/Spectre/Admin.pm @@ -145,7 +145,6 @@ sub new { my $logger = Log::Log4perl->get_logger($config->getFilename); my $self = {_debug=>$debug, _config=>$config, _logger=>$logger}; bless $self, $class; - $self->runTests(); $self->debug("Trying to bind to ".$config->get("ip").":".$config->get("port")); create_ikc_server( ip => $config->get("ip"), @@ -179,38 +178,42 @@ sub ping { =head2 runTests ( ) -Executes a test to see if Spectre can establish a connection to WebGUI and get back a valid response. +Executes a test to see if Spectre can establish a connection to WebGUI and get back a valid response. This is a class method. + +=head3 config + +A WebGUI::Config object that represents the spectre.conf file. =cut sub runTests { - my $self = shift; + my $class = shift; my $config = shift; - $self->debug("Running connectivity tests."); - my $configs = WebGUI::Config->readAllConfigs($self->config->getWebguiRoot); - foreach my $config (keys %{$configs}) { + print "Running connectivity tests.\n"; + my $configs = WebGUI::Config->readAllConfigs($config->getWebguiRoot); + foreach my $key (keys %{$configs}) { next if $config =~ m/^demo/; - $self->debug("Testing $config"); + print "Testing $key\n"; my $userAgent = new LWP::UserAgent; $userAgent->agent("Spectre"); $userAgent->timeout(30); - my $url = "http://".$configs->{$config}->get("sitename")->[0].":".$self->config->get("webguiPort").$configs->{$config}->get("gateway")."?op=spectreTest"; + my $url = "http://".$configs->{$key}->get("sitename")->[0].":".$config->get("webguiPort").$configs->{$key}->get("gateway")."?op=spectreTest"; my $request = new HTTP::Request (GET => $url); my $response = $userAgent->request($request); if ($response->is_error) { - $self->error("Couldn't connect to WebGUI site $config"); + print "ERROR: Couldn't connect to WebGUI site $key\n"; } else { my $response = $response->content; if ($response eq "subnet") { - $self->error("Spectre cannot communicate with WebGUI for $config, perhaps you need to adjust the spectreSubnets setting in this config file."); + print "ERROR: Spectre cannot communicate with WebGUI for $key, perhaps you need to adjust the spectreSubnets setting in this config file.\n"; } elsif ($response eq "spectre") { - $self->error("WebGUI connot communicate with Spectre for $config, perhaps you need to adjust the spectreIp or spectrePort setting the this config file."); + print "ERROR: WebGUI connot communicate with Spectre for $key, perhaps you need to adjust the spectreIp or spectrePort setting the this config file."; } elsif ($response ne "success") { - $self->error("Spectre received an invalid response from WebGUI while testing $config"); + print "ERROR: Spectre received an invalid response from WebGUI while testing $key\n"; } } } - $self->debug("Tests completed."); + print "Tests completed.\n"; } diff --git a/lib/WebGUI/Commerce/ShoppingCart.pm b/lib/WebGUI/Commerce/ShoppingCart.pm index 87e585d58..96c56bbae 100644 --- a/lib/WebGUI/Commerce/ShoppingCart.pm +++ b/lib/WebGUI/Commerce/ShoppingCart.pm @@ -219,8 +219,7 @@ The instantiated plugin of this item. See WebGUI::Commerce::Item for a detailed sub getItems { my ($self, $periodResolve, %cartContent, $item, $properties, @recurring, @normal); $self = shift; - - $periodResolve = WebGUI::Commerce::Payment::recurringPeriodValues($self->session); + $periodResolve = WebGUI::Commerce::Payment->recurringPeriodValues($self->session); %cartContent = %{$self->{_items}}; foreach (values(%cartContent)) { $item = WebGUI::Commerce::Item->new($self->session,$_->{itemId}, $_->{itemType}); diff --git a/lib/WebGUI/Operation/Commerce.pm b/lib/WebGUI/Operation/Commerce.pm index 031a66708..1def2fa96 100644 --- a/lib/WebGUI/Operation/Commerce.pm +++ b/lib/WebGUI/Operation/Commerce.pm @@ -1145,7 +1145,7 @@ sub www_viewCart { $var{'checkoutForm.header'} = WebGUI::Form::formHeader($session,). WebGUI::Form::hidden($session,{name => 'op', value => 'checkout'}); $var{'checkoutForm.button'} = WebGUI::Form::submit($session,{value => $i18n->get('checkout')}); - $var{'checkoutForm.footer'} = WebGUI::Form::formFooter; + $var{'checkoutForm.footer'} = WebGUI::Form::formFooter($session); $var{normalItemsLoop} = $normal; $var{normalItems} = scalar(@$normal); diff --git a/lib/WebGUI/Operation/ProductManager.pm b/lib/WebGUI/Operation/ProductManager.pm index 27342d50b..3199ed744 100755 --- a/lib/WebGUI/Operation/ProductManager.pm +++ b/lib/WebGUI/Operation/ProductManager.pm @@ -192,7 +192,7 @@ sub www_editProduct { -name => 'sku', -label => $i18n->get('sku'), -hoverHelp => $i18n->get('sku description'), - -value => $session->form->process("sku") || $product->{SKU}, + -value => $session->form->process("sku") || $product->{sku}, -maxlength => 64, ); $f->template( diff --git a/lib/WebGUI/Operation/Spectre.pm b/lib/WebGUI/Operation/Spectre.pm index 3ff45f80d..7c97909ee 100644 --- a/lib/WebGUI/Operation/Spectre.pm +++ b/lib/WebGUI/Operation/Spectre.pm @@ -46,11 +46,11 @@ sub www_spectreTest { name=>rand(100000), timeout=>10 ); - $remote->disconnect; # Can't perform this test until I get smarter. =) - #return "spectre" unless $remote; - #my $result = $remote->post_respond('admin/ping'); - #return "spectre" unless defined $result; + return "spectre" unless defined $remote; + my $result = $remote->post_respond('admin/ping'); + $remote->disconnect; + return "spectre" unless defined $result; return "success"; } diff --git a/sbin/spectre.pl b/sbin/spectre.pl index 2f5bda4bf..0edaf1da3 100644 --- a/sbin/spectre.pl +++ b/sbin/spectre.pl @@ -23,6 +23,7 @@ my $ping; my $daemon; my $run; my $debug; +my $test; GetOptions( 'help'=>\$help, @@ -30,10 +31,11 @@ GetOptions( 'shutdown'=>\$shutdown, 'daemon'=>\$daemon, 'debug' =>\$debug, - 'run' => \$run + 'run' => \$run, + 'test' => \$test ); -if ($help || !($ping||$shutdown||$daemon||$run)) { +if ($help || !($ping||$shutdown||$daemon||$run||$test)) { print <runTests($config); } elsif ($run) { Spectre::Admin->new($config, $debug); } elsif ($daemon) {