Report abuse
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
@@ -232,6 +232,8 @@
my $page_layout;
if (my $blog_id = $tmpl->blog_id) {
$ctx->stash('blog_id', $blog_id);
+ $ctx->stash('local_blog_id', $blog_id)
+ unless $ctx->stash('local_blog_id');
my $blog = $ctx->stash('blog');
unless ($blog) {
$blog = MT::Blog->load($blog_id) or
@@ -240,6 +242,8 @@
$ctx->stash('blog', $blog);
} else {
$ctx->stash('blog_id', $blog->id);
+ $ctx->stash('local_blog_id', $blog->id)
+ unless $ctx->stash('local_blog_id');
}
MT->config->TimeOffset($blog->server_offset);
$page_layout = $blog->page_layout;
@@ -4689,7 +4775,14 @@
$type = 'widget';
$tmpl_name =~ s/^Widget: ?//;
}
- my $blog_id = $arg->{blog_id} || $ctx->{__stash}{blog_id} || 0;
+ my $blog_id = defined($arg->{blog_id})
+ ? $arg->{blog_id}
+ : ( $arg->{global} )
+ ? 0
+ : defined($ctx->{__stash}{blog_id})
+ ? $ctx->{__stash}{blog_id}
+ : 0;
+ $blog_id = $ctx->stash('local_blog_id') if $arg->{local};
my $stash_id = 'template_' . $type . '::' . $blog_id . '::' . $tmpl_name;
return $ctx->error(MT->translate("Recursion attempt on [_1]: [_2]", MT->translate($name), $tmpl_name))
if $include_stack{$stash_id};
|