[Jifty-commit] r7376 - jifty/trunk/lib/Jifty/Web/Form

Jifty commits jifty-commit at lists.jifty.org
Thu Aug 13 21:36:03 EDT 2009


Author: sartak
Date: Thu Aug 13 21:36:00 2009
New Revision: 7376

Modified:
   jifty/trunk/lib/Jifty/Web/Form/Field.pm

Log:
Treat preloaded regions that preload regions specially

Modified: jifty/trunk/lib/Jifty/Web/Form/Field.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Web/Form/Field.pm	(original)
+++ jifty/trunk/lib/Jifty/Web/Form/Field.pm	Thu Aug 13 21:36:00 2009
@@ -748,6 +748,15 @@
 
     return if !@preloaded;
 
+    # If we're inside a preloaded region, then we don't want to preload any
+    # other regions. Otherwise you could get into a cycle where you're always
+    # preloading the same set of regions. So we set it up so that when this
+    # preloaded region is put into the page, it will preload its child regions.
+    if (Jifty->web->request->preloading_region) {
+        my $region = Jifty->web->current_region->qualified_name;
+        return;
+    }
+
     my $preload_json = Jifty::JSON::objToJson(
         { fragments   => \@preloaded },
         { singlequote => 1 },


More information about the Jifty-commit mailing list