@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix error with inline comments on images

Summary: This data structure is a `dict<int, list<Comment>>` now, where the `int` is the line number.

Test Plan:
- Created a diff changing an image.
- Added inline comments on the left and right sides of the diff.
- Saw some exceptions and general sadness.
- Applied patch.
- Reloaded page.
- Everything worked great.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Differential Revision: https://secure.phabricator.com/D4264

+22 -18
+22 -18
src/applications/differential/render/DifferentialChangesetTwoUpRenderer.php
··· 403 403 404 404 $html_old = array(); 405 405 $html_new = array(); 406 - foreach ($this->getOldComments() as $comment) { 407 - $comment_html = $this->renderInlineComment($comment, $on_right = false); 408 - $html_old[] = 409 - '<tr class="inline">'. 410 - '<th />'. 411 - '<td class="left">'.$comment_html.'</td>'. 412 - '<th />'. 413 - '<td class="right3" colspan="3" />'. 414 - '</tr>'; 406 + foreach ($this->getOldComments() as $on_line => $comment_group) { 407 + foreach ($comment_group as $comment) { 408 + $comment_html = $this->renderInlineComment($comment, $on_right = false); 409 + $html_old[] = 410 + '<tr class="inline">'. 411 + '<th />'. 412 + '<td class="left">'.$comment_html.'</td>'. 413 + '<th />'. 414 + '<td class="right3" colspan="3" />'. 415 + '</tr>'; 416 + } 415 417 } 416 - foreach ($this->getNewComments() as $comment) { 417 - $comment_html = $this->renderInlineComment($comment, $on_right = true); 418 - $html_new[] = 419 - '<tr class="inline">'. 420 - '<th />'. 421 - '<td class="left" />'. 422 - '<th />'. 423 - '<td class="right3" colspan="3">'.$comment_html.'</td>'. 424 - '</tr>'; 418 + foreach ($this->getNewComments() as $lin_line => $comment_group) { 419 + foreach ($comment_group as $comment) { 420 + $comment_html = $this->renderInlineComment($comment, $on_right = true); 421 + $html_new[] = 422 + '<tr class="inline">'. 423 + '<th />'. 424 + '<td class="left" />'. 425 + '<th />'. 426 + '<td class="right3" colspan="3">'.$comment_html.'</td>'. 427 + '</tr>'; 428 + } 425 429 } 426 430 427 431 if (!$old) {