From 33997d43d0ea959826ec6a699a8dae9c42bea69c Mon Sep 17 00:00:00 2001 From: epriestley Date: Wed, 13 Mar 2013 08:06:10 -0700 Subject: [PATCH] Fix undefined index in ManiphestTaskSummaryView Summary: Currently, my homepage raises a couple of these: [13-Mar-2013 06:44:38] WARNING: [pool www] child 27678 said into stderr: "NOTICE: PHP message: [2013-03-13 06:44:38] ERROR 8: Undefined index: at [/INSECURE/devtools/phabricator/src/applications/maniphest/view/ManiphestTaskSummaryView.php:133]" [13-Mar-2013 06:44:38] WARNING: [pool www] child 27678 said into stderr: "NOTICE: PHP message: #0 ManiphestTaskSummaryView::render() called at [/INSECURE/devtools/phabricator/src/applications/maniphest/view/ManiphestTaskListView.php:45]" [13-Mar-2013 06:44:38] WARNING: [pool www] child 27678 said into stderr: "NOTICE: PHP message: #1 ManiphestTaskListView::render() called at [/INSECURE/devtools/phabricator/src/view/AphrontView.php:63]" [13-Mar-2013 06:44:38] WARNING: [pool www] child 27678 said into stderr: "NOTICE: PHP message: #2 AphrontView::producePhutilSafeHTML() called at [/INSECURE/devtools/libphutil/src/markup/render.php:65]" [13-Mar-2013 06:44:38] WARNING: [pool www] child 27678 said into stderr: "NOTICE: PHP message: #3 phutil_escape_html(Object ManiphestTaskListView)" [13-Mar-2013 06:44:38] WARNING: [pool www] child 27678 said into stderr: "NOTICE: PHP message: #4 array_map(phutil_escape_html, Array { 0 => Object ManiphestTaskListView }) called at [/INSECURE/devtools/libphutil/src/markup/render.php:120]" [13-Mar-2013 06:44:38] WARNING: [pool www] child 27678 said into stderr: "NOTICE: PHP message: #5 phutil_implode_html(, Array { 0 => Object ManiphestTaskListView }) called at [/INSECURE/devtools/phabricator/src/view/layout/AphrontPanelView.php:92]" [13-Mar-2013 06:44:38] WARNING: [pool www] child 27678 said into stderr: "NOTICE: PHP message: #6 AphrontPanelView::render() called at [/INSECURE/devtools/phabricator/src/view/AphrontView.php:63]" [13-Mar-2013 06:44:38] WARNING: [pool www] child 27678 said into stderr: "NOTICE: PHP message: #7 AphrontView::producePhutilSafeHTML() called at [/INSECURE/devtools/libphutil/src/markup/render.php:65]" [13-Mar-2013 06:44:38] WARNING: [pool www] child 27678 said into stderr: "NOTICE: PHP message: #8 phutil_escape_html(Object AphrontPanelView)" [13-Mar-2013 06:44:38] WARNING: [pool www] child 27678 said into stderr: "NOTICE: PHP message: #9 array_map(phutil_escape_html, Array of size 8 starting with: { 0 => Object AphrontPanelView }) called at [/INSECURE/devtools/libphutil/src/markup/render.php:85]" [13-Mar-2013 06:44:38] WARNING: [pool www] child 27678 said into stderr: "NOTICE: PHP message: #10 phutil_escape_html(Array of size 8 starting with: { 0 => Object AphrontPanelView })" [13-Mar-2013 06:44:38] WARNING: [pool www] child 27678 said into stderr: "NOTICE: PHP message: #11 array_map(phutil_escape_html, Array of size 2 starting with: { 0 => Array of size 8 starting with: { 0 => Object AphrontPanelView } }) called at [/INSECURE/devtools/libphutil/src/markup/render.php:85]" [13-Mar-2013 06:44:38] WARNING: [pool www] child 27678 said into stderr: "NOTICE: PHP message: #12 phutil_escape_html(Array of size 2 starting with: { 0 => Array of size 8 starting with: { 0 => Object AphrontPanelView } })" [13-Mar-2013 06:44:38] WARNING: [pool www] child 27678 said into stderr: "NOTICE: PHP message: #13 array_map(phutil_escape_html, Array of size 2 starting with: { 0 => null }) called at [/INSECURE/devtools/libphutil/src/markup/render.php:85]" [13-Mar-2013 06:44:38] WARNING: [pool www] child 27678 said into stderr: "NOTICE: PHP message: #14 phutil_escape_html(Array of size 2 starting with: { 0 => null }) called at [/INSECURE/devtools/libphutil/src/markup/render.php:53]" [13-Mar-2013 06:44:38] WARNING: [pool www] child 27678 said into stderr: "NOTICE: PHP message: #15 phutil_tag(div, Array of size 2 starting with: { class => phabricator-nav-content }, Array of size 2 starting with: { 0 => null }) called at [/INSECURE/devtools/phabricator/src/view/layout/AphrontSideNavFilterView.php:297]" [13-Mar-2013 06:44:38] WARNING: [pool www] child 27678 said into stderr: "NOTICE: PHP message: #16 AphrontSideNavFilterView::renderFlexNav() called at [/INSECURE/devtools/phabricator/src/view/layout/AphrontSideNavFilterView.php:184]" [13-Mar-2013 06:44:38] WARNING: [pool www] child 27678 said into stderr: "NOTICE: PHP message: #17 AphrontSideNavFilterView::render() called at [/INSECURE/devtools/phabricator/src/view/AphrontView.php:63]" [13-Mar-2013 06:44:38] WARNING: [pool www] child 27678 said into stderr: "NOTICE: PHP message: #18 AphrontView::producePhutilSafeHTML() called at [/INSECURE/devtools/libphutil/src/markup/render.php:65]" [13-Mar-2013 06:44:38] WARNING: [pool www] child 27678 said into stderr: "NOTICE: PHP message: #19 phutil_escape_html(Object AphrontSideNavFilterView)" [13-Mar-2013 06:44:38] WARNING: [pool www] child 27678 said into stderr: "NOTICE: PHP message: #20 array_map(phutil_escape_html, Array { 0 => Object AphrontSideNavFilterView }) called at [/INSECURE/devtools/libphutil/src/markup/render.php:120]" [13-Mar-2013 06:44:38] WARNING: [pool www] child 27678 said into stderr: "NOTICE: PHP message: #21 phutil_implode_html(, Array { 0 => Object AphrontSideNavFilterView }) called at [/INSECURE/devtools/phabricator/src/view/page/PhabricatorBarePageView.php:58]" [13-Mar-2013 06:44:38] WARNING: [pool www] child 27678 said into stderr: "NOTICE: PHP message: #22 PhabricatorBarePageView::willRenderPage() called at [/INSECURE/devtools/phabricator/src/view/page/PhabricatorStandardPageView.php:104]" [13-Mar-2013 06:44:38] WARNING: [pool www] child 27678 said into stderr: "NOTICE: PHP message: #23 PhabricatorStandardPageView::willRenderPage() called at [/INSECURE/devtools/phabricator/src/view/page/AphrontPageView.php:46]" [13-Mar-2013 06:44:38] WARNING: [pool www] child 27678 said into stderr: "NOTICE: PHP message: #24 AphrontPageView::render() called at [/INSECURE/devtools/phabricator/src/applications/directory/controller/PhabricatorDirectoryController.php:15]" [13-Mar-2013 06:44:38] WARNING: [pool www] child 27678 said into stderr: "NOTICE: PHP message: #25 PhabricatorDirectoryController::buildStandardPageResponse(Object AphrontSideNavFilterView, Array { title => Phabricator }) called at [/INSECURE/devtools/phabricator/src/applications/directory/controller/PhabricatorDirectoryMainController.php:66]" [13-Mar-2013 06:44:38] WARNING: [pool www] child 27678 said into stderr: "NOTICE: PHP message: #26 PhabricatorDirectoryMainController::buildMainResponse(Object AphrontSideNavFilterView, Array of size 8 starting with: { 5 => Object PhabricatorProject }) called at [/INSECURE/devtools/phabricator/src/applications/directory/controller/PhabricatorDirectoryMainController.php:27]" [13-Mar-2013 06:44:38] WARNING: [pool www] child 27678 said into stderr: "NOTICE: PHP message: #27 PhabricatorDirectoryMainController::processRequest() called at [/INSECURE/devtools/phabricator/webroot/index.php:91]" There two cases here: - There's no owner. In this case, we might-or-might-not have loaded the handle for the "empty" PHID, but we shouldn't try to render in either case. - There is an owner. In this case, we definitely should have loaded the handle, so it's fine for us to fatal if we didn't (it indicates a serious problem with the program). Test Plan: Loaded home page, no errors. Reviewers: chad, btrahan Reviewed By: chad CC: aran Differential Revision: https://secure.phabricator.com/D5329 --- src/applications/maniphest/view/ManiphestTaskSummaryView.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/applications/maniphest/view/ManiphestTaskSummaryView.php b/src/applications/maniphest/view/ManiphestTaskSummaryView.php index 6e67098ee5..bf0de2a01f 100644 --- a/src/applications/maniphest/view/ManiphestTaskSummaryView.php +++ b/src/applications/maniphest/view/ManiphestTaskSummaryView.php @@ -130,7 +130,7 @@ final class ManiphestTaskSummaryView extends ManiphestView { )); $owner = ''; - if ($handles[$task->getOwnerPHID()]) { + if ($task->getOwnerPHID()) { $owner = pht('Assigned to %s', $handles[$task->getOwnerPHID()]->renderLink()); }