@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix a fatal on user email settings when `account.editable` is disabled

Summary:
If `account.editable` is set to false, we try to add a `null` button and fatal:

> Argument 1 passed to PHUIHeaderView::addActionLink() must be an instance of PHUIButtonView, null given, called in /srv/phabricator/phabricator/src/applications/settings/panel/PhabricatorSettingsPanel.php on line 290

Instead, don't try to render `null` as a button.

Test Plan:
- Configured `account.editable` false.
- Viewed email address settings.
- Before: fatal.
- After: page works, no button is provided.

Reviewers: amckinley

Reviewed By: amckinley

Differential Revision: https://secure.phabricator.com/D18677

+3 -3
+3 -3
src/applications/settings/panel/PhabricatorEmailAddressesSettingsPanel.php
··· 138 138 $editable, 139 139 )); 140 140 141 - $button = null; 141 + $buttons = array(); 142 142 if ($editable) { 143 - $button = id(new PHUIButtonView()) 143 + $buttons[] = id(new PHUIButtonView()) 144 144 ->setTag('a') 145 145 ->setIcon('fa-plus') 146 146 ->setText(pht('Add New Address')) ··· 149 149 ->setColor(PHUIButtonView::GREY); 150 150 } 151 151 152 - return $this->newBox(pht('Email Addresses'), $table, array($button)); 152 + return $this->newBox(pht('Email Addresses'), $table, $buttons); 153 153 } 154 154 155 155 private function returnNewAddressResponse(