Skip to content

Bug 1896310 - Attached images are not displayed inline when the bug has no keywords - #2476

Merged
dklawren merged 4 commits into
mozilla:masterfrom
kyoshino:1896310-inline-images
Aug 21, 2025
Merged

dklawren merged 4 commits into
mozilla:masterfrom
kyoshino:1896310-inline-images

Conversation

@kyoshino

@kyoshino kyoshino commented Aug 20, 2025 •

Copy link
Copy Markdown
Collaborator

Bug 1896310 - Attached images are not displayed inline when the bug has no keywords

Remove the unnecessary check for bug_keywords introduced in #2132 and simplify the keyword test condition.

@kyoshino kyoshino changed the title Bug 1896310 - Attached images are not displayed inline unless bug has any keywords Bug 1896310 - Attached images are not displayed inline when the bug has no keywords Aug 20, 2025
@kyoshino

Copy link
Copy Markdown
Collaborator Author

Will figure out why the selenium test fails. Seems unrelated to the change, but not sure.

@dklawren

Copy link
Copy Markdown
Collaborator

Will figure out why the selenium test fails. Seems unrelated to the change, but not sure.

Yeah was looking at that myself just now. Something to with the check where we turn off attachment display in the admin params, then the attachment should only be downloadable and not viewable. Maybe we should also not display attachments inline if the attachment display parameter is set to off. If you click on the details link, it already blocks displaying the attachment.

@kyoshino

Copy link
Copy Markdown
Collaborator Author

Added debug code to the security test:

diag $sel->driver->execute_script('return document.body.innerHTML;');

And I could find the patch content in the dumped HTML:

#   </div><div id="att-5" class="attachment" data-id="5" itemscope="" itemtype="http://schema.org/MediaObject">
#       <meta itemprop="name" content="file_4.txt">
#       <meta itemprop="contentSize" content="819">
#       <meta itemprop="encodingFormat" content="text/plain">
#       <div class="label">
#         Attached file
#           <a class="link" href="attachment.cgi?id=5" itemprop="contentUrl">
#         <span id="att-5-description" itemprop="description">simple patch, v1</span></a>
#         — <a href="attachment.cgi?id=5&amp;action=edit" itemprop="url" data-details="1">Details</a>
#       </div>
#     <button type="button" role="link" title="file_4.txt" class="outer"><pre class=" language-plain" role="img" itemprop="text">Index: Bugzilla/Config/MTA.pm
# ===================================================================
# RCS file: /cvsroot/mozilla/webtools/bugzilla/Bugzilla/Config/MTA.pm,v
# retrieving revision 1.13
# diff -3 -p -u -r1.13 MTA.pm
# --- Bugzilla/Config/MTA.pm  13 Nov 2006 23:32:28 -0000  1.13
# +++ Bugzilla/Config/MTA.pm  9 Dec 2006 12:19:44 -0000
# @@ -44,7 +44,9 @@ sub get_param_list {
#    {
#     name =&gt; 'mail_delivery_method',
#     type =&gt; 's',
# -   choices =&gt; [Email::Send-&gt;new()-&gt;all_mailers(), 'None'],
# +   # Bugzilla is not ready yet to send mails to newsgroups, and 'IO'
# +   # is of no use for now as we already have our own 'Test' mode.
# +   choices =&gt; [grep {$_ ne 'NNTP' &amp;&amp; $_ ne 'IO'} Email::Send-&gt;new()-&gt;all_mailers(), 'None'],
#     default =&gt; 'Sendmail',
#     checker =&gt; \&amp;check_mail_delivery_method
#    },
# </pre></button></div>

@kyoshino
kyoshino requested a review from dklawren August 21, 2025 10:12

@dklawren dklawren left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice. Thanks!

@dklawren
dklawren merged commit ae5f280 into mozilla:master Aug 21, 2025
8 checks passed
@kyoshino
kyoshino deleted the 1896310-inline-images branch August 21, 2025 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants