1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-22 14:52:41 +01:00

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
This commit is contained in:
epriestley 2012-12-21 14:16:00 -08:00
parent 394340fd8f
commit 62bc3373e5

View file

@ -403,25 +403,29 @@ final class DifferentialChangesetTwoUpRenderer
$html_old = array();
$html_new = array();
foreach ($this->getOldComments() as $comment) {
$comment_html = $this->renderInlineComment($comment, $on_right = false);
$html_old[] =
'<tr class="inline">'.
'<th />'.
'<td class="left">'.$comment_html.'</td>'.
'<th />'.
'<td class="right3" colspan="3" />'.
'</tr>';
foreach ($this->getOldComments() as $on_line => $comment_group) {
foreach ($comment_group as $comment) {
$comment_html = $this->renderInlineComment($comment, $on_right = false);
$html_old[] =
'<tr class="inline">'.
'<th />'.
'<td class="left">'.$comment_html.'</td>'.
'<th />'.
'<td class="right3" colspan="3" />'.
'</tr>';
}
}
foreach ($this->getNewComments() as $comment) {
$comment_html = $this->renderInlineComment($comment, $on_right = true);
$html_new[] =
'<tr class="inline">'.
'<th />'.
'<td class="left" />'.
'<th />'.
'<td class="right3" colspan="3">'.$comment_html.'</td>'.
'</tr>';
foreach ($this->getNewComments() as $lin_line => $comment_group) {
foreach ($comment_group as $comment) {
$comment_html = $this->renderInlineComment($comment, $on_right = true);
$html_new[] =
'<tr class="inline">'.
'<th />'.
'<td class="left" />'.
'<th />'.
'<td class="right3" colspan="3">'.$comment_html.'</td>'.
'</tr>';
}
}
if (!$old) {