Skip to content

Commit b483c11

Browse files
author
epriestley
committed
Fix a bug where PhabricatorPasteQuery incorrectly rekeys results
Summary: I made changes here recently to improve robustness in the presence of missing files, but accidentally caused the results to re-key. Some callers depend on the mapping, and every other query is consistent about it. Restore the original behavior. Test Plan: `Pnnn` works again in remarkup. Reviewers: dctrwatson, chad Reviewed By: chad CC: aran Differential Revision: https://secure.phabricator.com/D6134
1 parent 3567f1a commit b483c11

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/applications/paste/query/PhabricatorPasteQuery.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ private function loadContent(array $pastes) {
199199
$key = $this->getContentCacheKey($paste);
200200
if (isset($caches[$key])) {
201201
$paste->attachContent(phutil_safe_html($caches[$key]));
202-
$results[$key] = $paste;
202+
$results[$paste->getID()] = $paste;
203203
} else {
204204
$need_raw[$key] = $paste;
205205
}
@@ -217,7 +217,7 @@ private function loadContent(array $pastes) {
217217
$paste->attachContent($content);
218218

219219
$write_data[$this->getContentCacheKey($paste)] = (string)$content;
220-
$results[$key] = $paste;
220+
$results[$paste->getID()] = $paste;
221221
}
222222

223223
$cache->setKeys($write_data);

0 commit comments

Comments
 (0)