Page MenuHomePhabricator

Creating first project/task is broken
Closed, ResolvedPublic

Description

As of 1db4de7dbc2c2462874258b047bc912881785621, new installs will blow up when trying to create the first project

[Fri Feb  5 22:58:01 2016] [2016-02-05 22:58:01] ERROR 8: Undefined index: project at [/home/avive/devtools/phabricator/src/view/form/control/AphrontFormPolicyControl.php:174]
[Fri Feb  5 22:58:01 2016] arcanist(head=master, ref.master=57f6fb59d739, custom=1), phabricator(head=master, ref.master=1db4de7dbc2c), phutil(head=master, ref.master=f43291e99d36)
[Fri Feb  5 22:58:01 2016]   #0 AphrontFormPolicyControl::getOptions() called at [<phabricator>/src/view/form/control/AphrontFormPolicyControl.php:264]
[Fri Feb  5 22:58:01 2016]   #1 AphrontFormPolicyControl::renderInput() called at [<phabricator>/src/view/form/control/AphrontFormControl.php:188]
[Fri Feb  5 22:58:01 2016]   #2 AphrontFormControl::render() called at [<phabricator>/src/view/AphrontView.php:176]
[Fri Feb  5 22:58:01 2016]   #3 AphrontView::producePhutilSafeHTML() called at [<phutil>/src/markup/render.php:133]
[Fri Feb  5 22:58:01 2016]   #4 phutil_escape_html(AphrontFormPolicyControl) called at [<phutil>/src/markup/render.php:157]
[Fri Feb  5 22:58:01 2016]   #5 phutil_escape_html(array) called at [<phutil>/src/markup/render.php:157]
[Fri Feb  5 22:58:01 2016]   #6 phutil_escape_html(array) called at [<phutil>/src/markup/render.php:119]
[Fri Feb  5 22:58:01 2016]   #7 phutil_tag(string, array, array) called at [<phabricator>/src/view/form/PHUIFormLayoutView.php:58]
[Fri Feb  5 22:58:01 2016]   #8 PHUIFormLayoutView::render() called at [<phabricator>/src/view/form/AphrontFormView.php:151]
[Fri Feb  5 22:58:01 2016]   #9 AphrontFormView::render() called at [<phabricator>/src/view/AphrontView.php:176]
[Fri Feb  5 22:58:01 2016]   #10 AphrontView::producePhutilSafeHTML() called at [<phutil>/src/markup/render.php:133]
[Fri Feb  5 22:58:01 2016]   #11 phutil_escape_html(AphrontFormView) called at [<phutil>/src/markup/render.php:157]
[Fri Feb  5 22:58:01 2016]   #12 phutil_escape_html(array) called at [<phutil>/src/markup/render.php:157]
[Fri Feb  5 22:58:01 2016]   #13 phutil_escape_html(array) called at [<phutil>/src/markup/render.php:157]
[Fri Feb  5 22:58:01 2016]   #14 phutil_escape_html(array) called at [<phutil>/src/markup/render.php:119]
[Fri Feb  5 22:58:01 2016]   #15 phutil_tag(string, array, array) called at [<phabricator>/src/infrastructure/javelin/markup.php:53]
[Fri Feb  5 22:58:01 2016]   #16 javelin_tag(string, array, array) called at [<phabricator>/src/view/AphrontTagView.php:152]
[Fri Feb  5 22:58:01 2016]   #17 AphrontTagView::render() called at [<phabricator>/src/view/AphrontView.php:176]
[Fri Feb  5 22:58:01 2016]   #18 AphrontView::producePhutilSafeHTML() called at [<phutil>/src/markup/render.php:133]
[Fri Feb  5 22:58:01 2016]   #19 phutil_escape_html(PHUIBoxView) called at [<phutil>/src/markup/render.php:139]
[Fri Feb  5 22:58:01 2016]   #20 phutil_escape_html(PHUIObjectBoxView) called at [<phutil>/src/markup/render.php:189]
[Fri Feb  5 22:58:01 2016]   #21 phutil_implode_html(string, array) called at [<phabricator>/src/view/page/PhabricatorBarePageView.php:58]
[Fri Feb  5 22:58:01 2016]   #22 PhabricatorBarePageView::willRenderPage() called at [<phabricator>/src/view/page/PhabricatorStandardPageView.php:195]
[Fri Feb  5 22:58:01 2016]   #23 PhabricatorStandardPageView::willRenderPage() called at [<phabricator>/src/view/page/AphrontPageView.php:46]
[Fri Feb  5 22:58:01 2016]   #24 AphrontPageView::render() called at [<phabricator>/src/view/page/PhabricatorStandardPageView.php:831]
[Fri Feb  5 22:58:01 2016]   #25 PhabricatorStandardPageView::produceAphrontResponse() called at [<phabricator>/src/aphront/configuration/AphrontApplicationConfiguration.php:603]
[Fri Feb  5 22:58:01 2016]   #26 AphrontApplicationConfiguration::produceResponse(AphrontRequest, PhabricatorStandardPageView) called at [<phabricator>/src/aphront/configuration/AphrontApplicationConfiguration.php:246]
[Fri Feb  5 22:58:01 2016]   #27 AphrontApplicationConfiguration::processRequest(AphrontRequest, PhutilDeferredLog, AphrontPHPHTTPSink, MultimeterControl) called at [<phabricator>/src/aphront/configuration/AphrontApplicationConfiguration.php:149]
[Fri Feb  5 22:58:01 2016]   #28 AphrontApplicationConfiguration::runHTTPRequest(AphrontPHPHTTPSink) called at [<phabricator>/webroot/index.php:17]

If there already are some objects, it does work.

Revisions and Commits

Event Timeline

Looks like it was broken at e1c934ab22d8c0d88ec1ce0d73bc497e563b4acb (Works at 8a9f7609755af5e32c2c287c4b732d213cb680ee).

Turns out that it's not just if zero projects exist, but if the user attempting to create a project does not belong to any project themselves. i.e. no projects are shown.

That fits what the code does - it looks like it gathers all good options, and that includes a "some" projects, if any.

I think that the actual fix here is adding if ($options[$type_project]) around the isort.

I've also learned this magic:

$x = array();
$x['foo']['bar'] = 'baz';

magically creates an extra array() for $x['foo'].

epriestley closed this task as Resolved by committing Restricted Diffusion Commit.Feb 6 2016, 12:47 PM
epriestley added a commit: Restricted Diffusion Commit.
epriestley triaged this task as High priority.