fu: Close-up of Fu, bringing a scoop of water to her mouth (Default)
fu ([personal profile] fu) wrote in [site community profile] changelog2012-01-10 07:15 am

[dw-free] console-suspend.t fails on dreamhack

[commit: http://hg.dwscoalition.org/dw-free/rev/70b2250cb3c8]

http://bugs.dwscoalition.org/show_bug.cgi?id=4202

SHort-circuit if we don't have sphinx set up.

Patch by [personal profile] kareila.

Files modified:
  • cgi-bin/DW/Hooks/SiteSearch.pm
--------------------------------------------------------------------------------
diff -r 406739fa9fad -r 70b2250cb3c8 cgi-bin/DW/Hooks/SiteSearch.pm
--- a/cgi-bin/DW/Hooks/SiteSearch.pm	Mon Jan 09 23:44:19 2012 +0800
+++ b/cgi-bin/DW/Hooks/SiteSearch.pm	Tue Jan 10 15:16:21 2012 +0800
@@ -29,7 +29,7 @@
     my %opts = @_;
     return unless $opts{prop} eq 'opt_blockglobalsearch';
 
-    my $dbh = _sphinx_db();
+    my $dbh = _sphinx_db() or return 0;
     $dbh->do( 'UPDATE posts_raw SET allow_global_search = ? WHERE journal_id = ?',
               undef, $opts{value} eq 'Y' ? 0 : 1, $opts{u}->id );
     die $dbh->errstr if $dbh->err;
@@ -45,7 +45,7 @@
 sub _mark_deleted {
     my ( $u, $is_deleted ) = @_;
 
-    my $dbh = _sphinx_db();
+    my $dbh = _sphinx_db() or return 0;
     $dbh->do( 'UPDATE posts_raw SET is_deleted = ? where journal_id = ?',
               undef, $is_deleted, $u->id );
     die $dbh->errstr if $dbh->err;
--------------------------------------------------------------------------------