mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-19 13:22:42 +01:00
Fix fatal on project list
Summary: Until T605 gets fixed, you might end up with a Project without a Profile if the Profile insert failed. This fatals the list view; instead, don't fatal if a profile is missing. (At some point we should probably just merge this field into the Project object, I was just mimicking the user/profile separation but we have partial-field object support now and Projects aren't super heavily used or very big.) Test Plan: - Viewed list view including a project with a missing profile. - Edited the project, creating its profile. Reviewers: btrahan, jungejason Reviewed By: btrahan CC: arice, aran, btrahan Differential Revision: https://secure.phabricator.com/D1368
This commit is contained in:
parent
49cf1ca10c
commit
8b3ab97d64
1 changed files with 8 additions and 4 deletions
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright 2011 Facebook, Inc.
|
* Copyright 2012 Facebook, Inc.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -105,7 +105,7 @@ class PhabricatorProjectListController
|
||||||
foreach ($projects as $project) {
|
foreach ($projects as $project) {
|
||||||
$phid = $project->getPHID();
|
$phid = $project->getPHID();
|
||||||
|
|
||||||
$profile = $profiles[$phid];
|
$profile = idx($profiles, $phid);
|
||||||
$affiliations = $affil_groups[$phid];
|
$affiliations = $affil_groups[$phid];
|
||||||
|
|
||||||
$group = idx($groups, $phid, array());
|
$group = idx($groups, $phid, array());
|
||||||
|
@ -113,8 +113,12 @@ class PhabricatorProjectListController
|
||||||
|
|
||||||
$population = count($affiliations);
|
$population = count($affiliations);
|
||||||
|
|
||||||
|
if ($profile) {
|
||||||
$blurb = $profile->getBlurb();
|
$blurb = $profile->getBlurb();
|
||||||
$blurb = phutil_utf8_shorten($blurb, 64);
|
$blurb = phutil_utf8_shorten($blurb, 64);
|
||||||
|
} else {
|
||||||
|
$blurb = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
$rows[] = array(
|
$rows[] = array(
|
||||||
|
|
Loading…
Reference in a new issue