Skip to content

Commit

Permalink
do not abort MTSitesLocalSite when local_blog_id is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
jamadam committed Sep 29, 2022
1 parent 070a519 commit 5fd0d9a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
15 changes: 7 additions & 8 deletions php/lib/block.mtsiteslocalsite.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,14 @@
function smarty_block_mtsiteslocalsite($args, $content, &$ctx, &$repeat) {
$localvars = array('local_blog_id', 'blog_id', 'blog');
if (!isset($content)) {
$blog_id = $ctx->stash('local_blog_id');
if (!$blog_id) {
$repeat = false;
return '';
$blog_id = $ctx->stash('blog_id');
$local_blog_id = $ctx->stash('local_blog_id');
if ($local_blog_id) {
$ctx->localize($localvars);
$blog = $ctx->mt->db()->fetch_blog($local_blog_id);
$ctx->stash('blog_id', $local_blog_id);
$ctx->stash('blog', $blog);
}
$ctx->localize($localvars);
$blog = $ctx->mt->db()->fetch_blog($blog_id);
$ctx->stash('blog', $blog);
$ctx->stash('blog_id', $blog_id);
} else {
$repeat = false;
}
Expand Down
1 change: 0 additions & 1 deletion t/mt7/multiblog/02.tags.t
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,6 @@ template-module:2
{ 1 => 2, 2 => 2 }
=== MTC-28598 mt:MultiBlogLocalBlog inside mt:Tags
--- skip_php
--- template
<mt:MultiBlog mode="context">:<MTTags glue=','><mt:BlogID>:<mt:MultiBlogLocalBlog><mt:BlogID></mt:MultiBlogLocalBlog></MTTags></mt:MultiBlog>
--- expected
Expand Down

0 comments on commit 5fd0d9a

Please sign in to comment.