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:
@@ -5044,6 +5044,7 @@ phutil_register_library_map(array(
|
|||||||
'PhabricatorWeekStartDaySetting' => 'applications/settings/setting/PhabricatorWeekStartDaySetting.php',
|
'PhabricatorWeekStartDaySetting' => 'applications/settings/setting/PhabricatorWeekStartDaySetting.php',
|
||||||
'PhabricatorWildConfigType' => 'applications/config/type/PhabricatorWildConfigType.php',
|
'PhabricatorWildConfigType' => 'applications/config/type/PhabricatorWildConfigType.php',
|
||||||
'PhabricatorWordPressAuthProvider' => 'applications/auth/provider/PhabricatorWordPressAuthProvider.php',
|
'PhabricatorWordPressAuthProvider' => 'applications/auth/provider/PhabricatorWordPressAuthProvider.php',
|
||||||
|
'PhabricatorWorkboardInterface' => 'applications/project/interface/PhabricatorWorkboardInterface.php',
|
||||||
'PhabricatorWorkboardViewState' => 'applications/project/state/PhabricatorWorkboardViewState.php',
|
'PhabricatorWorkboardViewState' => 'applications/project/state/PhabricatorWorkboardViewState.php',
|
||||||
'PhabricatorWorker' => 'infrastructure/daemon/workers/PhabricatorWorker.php',
|
'PhabricatorWorker' => 'infrastructure/daemon/workers/PhabricatorWorker.php',
|
||||||
'PhabricatorWorkerActiveTask' => 'infrastructure/daemon/workers/storage/PhabricatorWorkerActiveTask.php',
|
'PhabricatorWorkerActiveTask' => 'infrastructure/daemon/workers/storage/PhabricatorWorkerActiveTask.php',
|
||||||
@@ -10748,6 +10749,7 @@ phutil_register_library_map(array(
|
|||||||
'PhabricatorColumnProxyInterface',
|
'PhabricatorColumnProxyInterface',
|
||||||
'PhabricatorSpacesInterface',
|
'PhabricatorSpacesInterface',
|
||||||
'PhabricatorEditEngineSubtypeInterface',
|
'PhabricatorEditEngineSubtypeInterface',
|
||||||
|
'PhabricatorWorkboardInterface',
|
||||||
),
|
),
|
||||||
'PhabricatorProjectActivityChartEngine' => 'PhabricatorChartEngine',
|
'PhabricatorProjectActivityChartEngine' => 'PhabricatorChartEngine',
|
||||||
'PhabricatorProjectAddHeraldAction' => 'PhabricatorProjectHeraldAction',
|
'PhabricatorProjectAddHeraldAction' => 'PhabricatorProjectHeraldAction',
|
||||||
|
|||||||
@@ -301,6 +301,12 @@ final class PhabricatorBoardLayoutEngine extends Phobject {
|
|||||||
->execute();
|
->execute();
|
||||||
$boards = mpull($boards, null, 'getPHID');
|
$boards = mpull($boards, null, 'getPHID');
|
||||||
|
|
||||||
|
foreach ($boards as $key => $board) {
|
||||||
|
if (!($board instanceof PhabricatorWorkboardInterface)) {
|
||||||
|
unset($boards[$key]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!$this->fetchAllBoards) {
|
if (!$this->fetchAllBoards) {
|
||||||
foreach ($boards as $key => $board) {
|
foreach ($boards as $key => $board) {
|
||||||
if (!$board->getHasWorkboard()) {
|
if (!$board->getHasWorkboard()) {
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
interface PhabricatorWorkboardInterface {}
|
||||||
@@ -13,7 +13,8 @@ final class PhabricatorProject extends PhabricatorProjectDAO
|
|||||||
PhabricatorConduitResultInterface,
|
PhabricatorConduitResultInterface,
|
||||||
PhabricatorColumnProxyInterface,
|
PhabricatorColumnProxyInterface,
|
||||||
PhabricatorSpacesInterface,
|
PhabricatorSpacesInterface,
|
||||||
PhabricatorEditEngineSubtypeInterface {
|
PhabricatorEditEngineSubtypeInterface,
|
||||||
|
PhabricatorWorkboardInterface {
|
||||||
|
|
||||||
protected $name;
|
protected $name;
|
||||||
protected $status = PhabricatorProjectStatus::STATUS_ACTIVE;
|
protected $status = PhabricatorProjectStatus::STATUS_ACTIVE;
|
||||||
|
|||||||
Reference in New Issue
Block a user