@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 an off-by-one error affecting mail rendering of inlines on the final line of a file

Summary: Depends on D19837. Ref T13216. See PHI985. There's an off-by-one error here between how inline comments store "length" and how context rendering treats "length". We need to add 1 to the length, but currently do it a little too early. Do it slightly later so that inlines on the final line of a file render properly.

Test Plan: Left an inline on the final line of a new file, saw it render properly in HTML mail.

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T13216

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

+13 -6
+1 -1
src/applications/differential/mail/DifferentialInlineCommentMailView.php
··· 361 361 362 362 return $parser->render( 363 363 $start - $context, 364 - $length + 1 + (2 * $context), 364 + $length + (2 * $context), 365 365 array()); 366 366 } 367 367
+8 -1
src/applications/differential/parser/DifferentialChangesetParser.php
··· 874 874 $offset_map = $this->old; 875 875 } 876 876 877 + // NOTE: Inline comments use zero-based lengths. For example, a comment 878 + // that starts and ends on line 123 has length 0. Rendering considers 879 + // this range to have length 1. Probably both should agree, but that 880 + // ship likely sailed long ago. Tweak things here to get the two systems 881 + // to agree. See PHI985, where this affected mail rendering of inline 882 + // comments left on the final line of a file. 883 + 877 884 $range_end = $this->getOffset($offset_map, $range_start + $range_len); 878 885 $range_start = $this->getOffset($offset_map, $range_start); 879 - $range_len = ($range_end - $range_start); 886 + $range_len = ($range_end - $range_start) + 1; 880 887 } 881 888 882 889 $render_pch = $this->shouldRenderPropertyChangeHeader($this->changeset);
+4 -4
src/applications/feed/PhabricatorFeedStoryPublisher.php
··· 133 133 134 134 queryfx( 135 135 $conn, 136 - 'INSERT INTO %T (objectPHID, chronologicalKey) VALUES %Q', 136 + 'INSERT INTO %T (objectPHID, chronologicalKey) VALUES %LQ', 137 137 $ref->getTableName(), 138 - implode(', ', $sql)); 138 + $sql); 139 139 } 140 140 141 141 $subscribed_phids = $this->subscribedPHIDs; ··· 191 191 $conn, 192 192 'INSERT INTO %T '. 193 193 '(primaryObjectPHID, userPHID, chronologicalKey, hasViewed) '. 194 - 'VALUES %Q', 194 + 'VALUES %LQ', 195 195 $notif->getTableName(), 196 - implode(', ', $sql)); 196 + $sql); 197 197 } 198 198 199 199 PhabricatorUserCache::clearCaches(