From 0b6ef61e4023a36108d190b1a5099df242a31bdf Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Thu, 29 Oct 2020 12:29:29 -0400 Subject: [PATCH] fix: createNewPosts to build tpl with ajaxify.data If the post template contains references to items outside of the scope of the post, then when the post is loaded via IS, the expected values are empty. This was due to createNewPosts calling app.parseAndTranslate with a subset of the page payload. This works fine in Persona (and most other themes) because they do not refer to properties outside of the post object, but it may be helpful to include the rest of the ajaxify data as well. --- public/src/client/topic/posts.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/src/client/topic/posts.js b/public/src/client/topic/posts.js index b848d403ffc3..5f3b59c69c2d 100644 --- a/public/src/client/topic/posts.js +++ b/public/src/client/topic/posts.js @@ -191,7 +191,7 @@ define('forum/topic/posts', [ $(window).trigger('action:posts.loading', { posts: data.posts, after: after, before: before }); - app.parseAndTranslate('topic', 'posts', data, function (html) { + app.parseAndTranslate('topic', 'posts', Object.assign({}, ajaxify.data, data), function (html) { html = html.filter(function () { var pid = $(this).attr('data-pid'); return pid && $('[component="post"][data-pid="' + pid + '"]').length === 0;