From b69ebc4ba9a2974f2a95b2d3ef5c46f3c8cf2b9c Mon Sep 17 00:00:00 2001 From: Kohei Yoshino Date: Thu, 4 Apr 2019 16:59:24 -0400 Subject: [PATCH] Bug 1541231 - Certain Phablicator requests are displayed as inline attachment --- .../template/en/default/bug_modal/activity_stream.html.tmpl | 3 ++- extensions/BugModal/web/comments.js | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/extensions/BugModal/template/en/default/bug_modal/activity_stream.html.tmpl b/extensions/BugModal/template/en/default/bug_modal/activity_stream.html.tmpl index 7d470e107..55c792dfa 100644 --- a/extensions/BugModal/template/en/default/bug_modal/activity_stream.html.tmpl +++ b/extensions/BugModal/template/en/default/bug_modal/activity_stream.html.tmpl @@ -262,6 +262,7 @@ class="attachment[% " patch" IF att.ispatch; " obsolete" IF att.isobsolete; " deleted" IF !att.datasize %]" data-id="[% att.id FILTER none %]" itemscope itemtype="http://schema.org/MediaObject" [% IF comment.collapsed +%] style="display:none"[% END ~%]> +
@@ -274,7 +275,7 @@ [% ELSE %] [% END %] - [% att.description FILTER html %] + [% att.description FILTER html %] [% " (obsolete)" IF att.isobsolete; " (deleted)" IF !att.datasize %] — [% IF att.ispatch && Param('splinter_base') %] diff --git a/extensions/BugModal/web/comments.js b/extensions/BugModal/web/comments.js index 38dcfb73a..359612916 100644 --- a/extensions/BugModal/web/comments.js +++ b/extensions/BugModal/web/comments.js @@ -560,7 +560,7 @@ Bugzilla.BugModal.Comments = class Comments { async show_attachment($att) { const id = Number($att.dataset.id); const link = $att.querySelector('.link').href; - const name = $att.querySelector('[itemprop="name"]').textContent; + const name = $att.querySelector('[itemprop="name"]').content; const type = $att.querySelector('[itemprop="encodingFormat"]').content; const size = Number($att.querySelector('[itemprop="contentSize"]').content); const max_size = 2000000; -- 2.47.3