@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 issue where added or removed source files could incorrectly select a DocumentEngine

Summary:
Ref T13425. The changes in D20865 could incorrectly lead to selection of a DocumentEngine that can not generate document diffs if a file was added or removed (for example, when a source file is added).

Move the engine pruning code to be shared -- we should always discard engines which can't generate a diff, even if we don't have both documents.

Test Plan: Viewed an added source file, no more document ref error arising from document engine selection.

Maniphest Tasks: T13425

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

+6 -6
+6 -6
src/applications/differential/parser/DifferentialChangesetParser.php
··· 1743 1743 if ($new_engines !== null && $old_engines !== null) { 1744 1744 $shared_engines = array_intersect_key($new_engines, $old_engines); 1745 1745 $default_engine = head_key($new_engines); 1746 - 1747 - foreach ($shared_engines as $key => $shared_engine) { 1748 - if (!$shared_engine->canDiffDocuments($old_ref, $new_ref)) { 1749 - unset($shared_engines[$key]); 1750 - } 1751 - } 1752 1746 } else if ($new_engines !== null) { 1753 1747 $shared_engines = $new_engines; 1754 1748 $default_engine = head_key($shared_engines); ··· 1757 1751 $default_engine = head_key($shared_engines); 1758 1752 } else { 1759 1753 return null; 1754 + } 1755 + 1756 + foreach ($shared_engines as $key => $shared_engine) { 1757 + if (!$shared_engine->canDiffDocuments($old_ref, $new_ref)) { 1758 + unset($shared_engines[$key]); 1759 + } 1760 1760 } 1761 1761 1762 1762 $engine_key = $this->getDocumentEngineKey();