Only show the warning if we're in web context (module is being run by 
apache). This prevents the warning from being printed out when running tests, 
which causes tests to fail on dev enviroments without GCO installed.

        Patch by kareila. 

diffs (17 lines):

diff -r c8d6107aa1b5 -r 54af92f900a1 cgi-bin/DW/Shop/Engine/GoogleCheckout.pm
--- a/cgi-bin/DW/Shop/Engine/GoogleCheckout.pm  Fri Jun 04 23:33:03 2010 +0800
+++ b/cgi-bin/DW/Shop/Engine/GoogleCheckout.pm  Sat Jun 05 00:10:18 2010 +0800
@@ -36,8 +36,12 @@ use Google::Checkout::General::Util qw/ 
 use Google::Checkout::General::Util qw/ is_gco_error /;
 1;
 USE
+    # This restricts the warning to only print in web context,
+    # which allows t/00-compile.t to succeed without GC modules.
+    # There's no way to use LJ::is_enabled( 'googlecheckout' )
+    # without changing the module load order for the entire system.
     warn "NOTE: Google::Checkout::* Perl modules were not found.\n"
-        unless $rv;
+        if !$rv and ( $^X =~ /apache/ );
 
     # avoid compile error, if we don't have the google checkout modules 
installed
     our $EMAIL_DELIVERY = eval { no strict "subs"; 
Google::Checkout::General::DigitalContent::EMAIL_DELIVERY };
_______________________________________________
dw-changelog mailing list
[email protected]
http://lists.dwscoalition.org/mailman/listinfo/dw-changelog

Reply via email to