properly capture the currentDescriptorByNameUrl (when <l:renderOnDemand> is nested twice)

This commit is contained in:
Kohsuke Kawaguchi committed 2011-04-21 13:39:45 -07:00
1 parent 3eb1a16f64
commit f9f4c417c6
1 file changed
+2 -4
@@ -24,6 +24,7 @@
package hudson.widgets;
import hudson.Util;
import hudson.model.Descriptor;
import hudson.model.DescriptorByNameOwner;
import hudson.util.IOException2;
import hudson.util.PackedMap;
@@ -74,10 +75,7 @@ public class RenderOnDemandClosure {
variables.put(v,context.getVariable(v));
// capture the current base of context for descriptors
StaplerRequest req = Stapler.getCurrentRequest();
Ancestor a = req.findAncestor(DescriptorByNameOwner.class);
currentDescriptorByNameUrl = a.getUrl();
currentDescriptorByNameUrl = Descriptor.getCurrentDescriptorByNameUrl();
this.variables = PackedMap.of(variables);
}