[Jifty-commit] r3518 - jifty/branches/trimclient/lib/Jifty/Plugin/REST

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Sun Jun 17 19:25:46 EDT 2007


Author: clkao
Date: Sun Jun 17 19:25:46 2007
New Revision: 3518

Modified:
   jifty/branches/trimclient/lib/Jifty/Plugin/REST/Dispatcher.pm

Log:
workaround json dumper not liking scalar defer.

Modified: jifty/branches/trimclient/lib/Jifty/Plugin/REST/Dispatcher.pm
==============================================================================
--- jifty/branches/trimclient/lib/Jifty/Plugin/REST/Dispatcher.pm	(original)
+++ jifty/branches/trimclient/lib/Jifty/Plugin/REST/Dispatcher.pm	Sun Jun 17 19:25:46 2007
@@ -212,6 +212,11 @@
     elsif ($accept =~ /j(?:ava)?s|ecmascript/i) {
         $apache->header_out('Content-Type' => 'application/javascript; charset=UTF-8');
         $apache->send_http_header;
+	# XXX: temporary hack to fix _() that aren't respected by json dumper
+	for (values %{$_[0]}) {
+	    $_->{label} = "$_->{label}" if exists $_->{label} && defined ref $_->{label};
+	    $_->{hints} = "$_->{hints}" if exists $_->{hints} && defined ref $_->{hints};
+	}
         print 'var $_ = ', Jifty::JSON::objToJson( @_, { singlequote => 1 } );
     }
     elsif ($accept =~ qr{^(?:application/x-)?(?:perl|pl)$}i) {


More information about the Jifty-commit mailing list