Fix a fatal in the "Projects" curtain extension when a project edge connects an object to a non-project

Summary:
Ref T13429. It's currently possible to write "TYPE_EDGE" relationships for the "object has project" edge to PHIDs which may not actually be projects. Today, this fatals.

As a first step, unfatal it. T13429 discusses general improvements and greater context.

Test Plan:
Used "maniphest.edit" to write a "project" edge to a user PHID, viewed the task in the UI. Previously it fataled; now it renders unusually (the object is "tagged" with a user) but faithfully reflects database state.

{F6957606}

Maniphest Tasks: T13429

Differential Revision: https://secure.phabricator.com/D20860
This commit is contained in:
epriestley
2019-10-17 09:39:26 -07:00
parent d34dfa3746
commit f497b93e43
4 changed files with 13 additions and 1 deletions

View File

@@ -301,6 +301,12 @@ final class PhabricatorBoardLayoutEngine extends Phobject {
->execute();
$boards = mpull($boards, null, 'getPHID');
foreach ($boards as $key => $board) {
if (!($board instanceof PhabricatorWorkboardInterface)) {
unset($boards[$key]);
}
}
if (!$this->fetchAllBoards) {
foreach ($boards as $key => $board) {
if (!$board->getHasWorkboard()) {