<ul dir="auto">
<li>Note description is not shown if there are no visible comments or if the first visible comment is not the first actual comment. In the latter case the first visible comment is shown below "Created by", "Location" etc along with regular comments.</li>
<li>Since reading <code class="notranslate">note.author</code> may cause a crash, don't read it, use <code class="notranslate">note.all_comments.first.author</code> instead. <code class="notranslate">note.all_comments.last.author</code> was already in use. If this user is deleted, the comment will be shown as "by deleted".</li>
</ul>
<p dir="auto">This should allow not to crash on notes without comments, fixing <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="411191164" data-permission-text="Title is private" data-url="https://github.com/openstreetmap/openstreetmap-website/issues/2146" data-hovercard-type="issue" data-hovercard-url="/openstreetmap/openstreetmap-website/issues/2146/hovercard" href="https://github.com/openstreetmap/openstreetmap-website/issues/2146">#2146</a> (and <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="420482515" data-permission-text="Title is private" data-url="https://github.com/openstreetmap/openstreetmap-website/issues/2176" data-hovercard-type="pull_request" data-hovercard-url="/openstreetmap/openstreetmap-website/pull/2176/hovercard" href="https://github.com/openstreetmap/openstreetmap-website/pull/2176">#2176</a> should not be required).</p>
<p dir="auto">That's not a complete fix for notes without comments because some client-side js expects comments to be present.</p>
<hr>
<h4>You can view, comment on, or merge this pull request online at:</h4>
<p> <a href='https://github.com/openstreetmap/openstreetmap-website/pull/3608'>https://github.com/openstreetmap/openstreetmap-website/pull/3608</a></p>
<h4>Commit Summary</h4>
<ul>
<li><a href="https://github.com/openstreetmap/openstreetmap-website/pull/3608/commits/402fb948c2fd47b2124193097c27815e9b3c49f4" class="commit-link">402fb94</a> Don't show note description if all comments are hidden</li>
<li><a href="https://github.com/openstreetmap/openstreetmap-website/pull/3608/commits/207840c41f268b5b277c5455a585806ab26267c8" class="commit-link">207840c</a> Don't show first visible comment as a description if it's not the first actual comment</li>
<li><a href="https://github.com/openstreetmap/openstreetmap-website/pull/3608/commits/ed81e4cb4a3d5e45802940e319cf1a273092c3fb" class="commit-link">ed81e4c</a> Don't access note.author because it's unreliable</li>
</ul>
<h4 style="display: inline-block">File Changes </h4> <p style="display: inline-block">(<a href="https://github.com/openstreetmap/openstreetmap-website/pull/3608/files">3 files</a>)</p>
<ul>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/3608/files#diff-a3926db6e853b8fb775271c951ca4789b9ba3884dfedc631bf211bd650952882">app/controllers/browse_controller.rb</a>
(1)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/3608/files#diff-c90a6599296c0b71654cb5f0bb5c8166da6fc66966056e39ff0e4f967233a8ea">app/views/browse/note.html.erb</a>
(18)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/3608/files#diff-01df9fbcb9fb4907831d5bf348fc535f13caf85ed834db5f3f039c2407bf97bf">test/controllers/browse_controller_test.rb</a>
(32)
</li>
</ul>
<h4>Patch Links:</h4>
<ul>
<li><a href='https://github.com/openstreetmap/openstreetmap-website/pull/3608.patch'>https://github.com/openstreetmap/openstreetmap-website/pull/3608.patch</a></li>
<li><a href='https://github.com/openstreetmap/openstreetmap-website/pull/3608.diff'>https://github.com/openstreetmap/openstreetmap-website/pull/3608.diff</a></li>
</ul>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/openstreetmap/openstreetmap-website/pull/3608">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLJLHWYUOI5LBTN242DVVASYRANCNFSM54EKRSLA">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAK2OLOZXEHY45KBUZGYDELVVASYRA5CNFSM54EKRSLKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4TRLMNBA.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span><openstreetmap/openstreetmap-website/pull/3608</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/openstreetmap-website/pull/3608",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/3608",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>