fu: Close-up of Fu, bringing a scoop of water to her mouth (Default)
fu ([personal profile] fu) wrote in [site community profile] changelog2010-09-13 11:16 am

[dw-free] Entryprops viewer sometimes dies without saying anything useful.

[commit: http://hg.dwscoalition.org/dw-free/rev/7f4f14dd312a]

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

Push on past the error; try to get information about the problem (raw view
will show us lots of gibberish, but we may be able to pick out the
crossposted ids from it)

Patch by [personal profile] fu.

Files modified:
  • htdocs/admin/entryprops.bml
--------------------------------------------------------------------------------
diff -r 75db4193e08b -r 7f4f14dd312a htdocs/admin/entryprops.bml
--- a/htdocs/admin/entryprops.bml	Sun Sep 12 13:24:13 2010 -0500
+++ b/htdocs/admin/entryprops.bml	Mon Sep 13 19:16:12 2010 +0800
@@ -83,7 +83,12 @@ body<=
             # render xpost prop into human readable form
             if ( $prop eq "xpost" || $prop eq "xpostdetail" ) {
                 my %external_accounts_map = map { $_->acctid => $_->servername } DW::External::Account->get_external_accounts( $entry->poster );
-                my %xpost_map = %{ DW::External::Account->xpost_string_to_hash( $props{$prop} ) };
+
+                # FIXME: temporary; trying to figure out when this is undef
+                my $xpost_prop = $props{$prop};
+                my $xpost_hash = DW::External::Account->xpost_string_to_hash( $props{$prop} );
+                my %xpost_map = %{ $xpost_hash || {} };
+
                 if ( $prop eq "xpost" ) {
                     $props{$prop} = join ", ", map { ( $external_accounts_map{$_} || "unknown" ) . " => $xpost_map{$_}" } keys %xpost_map;
                     $p->{des} .= " (site name => itemid)";
@@ -91,6 +96,10 @@ body<=
                     $props{$prop} = join ", ", map { ( $external_accounts_map{$_} || "unknown" ) . " => { $xpost_map{$_}->{itemid}, $xpost_map{$_}->{url} }" } keys %xpost_map;
                     $p->{des} .= " (site name => { itemid, url })";
                 }
+
+                # FIXME: temporary
+                $props{$prop} .= "raw information about $prop - <input type='text' value='$xpost_prop' />" 
+                    unless $xpost_hash;
             }
 
             $extra = "<br /><small>$p->{des}</small>";
--------------------------------------------------------------------------------