@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.

Render ApplicationSearch errors correctly

Summary:
Fixes T8774. When an ApplicationSearch page returned an error (e.g., using a "viewer()" query while logged out), we would try to add action links to a box without a header. Instead:

- If a box has no header, but has show/hide actions, just create an empty header so the view renders. This is a little silly looking but does what the caller asks.
- Always set the title on the result box, so we get a header.

Test Plan: Did an invalid (logged out, with viewer()) search. Did a valid search.

Reviewers: btrahan, chad

Reviewed By: chad

Subscribers: epriestley

Maniphest Tasks: T8774

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

+10 -8
+5 -7
src/applications/search/controller/PhabricatorApplicationSearchController.php
··· 185 185 $title = pht('Advanced Search'); 186 186 } 187 187 188 - $box = new PHUIObjectBoxView(); 188 + $header = id(new PHUIHeaderView()) 189 + ->setHeader($title); 190 + 191 + $box = id(new PHUIObjectBoxView()) 192 + ->setHeader($header); 189 193 190 194 if ($run_query || $named_query) { 191 195 $box->setShowHide( ··· 227 231 $saved_query); 228 232 } 229 233 230 - $header = id(new PHUIHeaderView()) 231 - ->setHeader($title); 232 234 if ($list->getActions()) { 233 235 foreach ($list->getActions() as $action) { 234 236 $header->addActionLink($action); 235 237 } 236 238 } 237 - 238 - $box->setHeader($header); 239 239 240 240 if ($list->getObjectList()) { 241 241 $box->setObjectList($list->getObjectList()); ··· 267 267 'This query specifies an invalid parameter. Review the '. 268 268 'query parameters and correct errors.'); 269 269 } 270 - } else { 271 - $box->setHeaderText($title); 272 270 } 273 271 274 272 if ($errors) {
+5 -1
src/view/phui/PHUIObjectBoxView.php
··· 190 190 } 191 191 192 192 public function render() { 193 - 194 193 require_celerity_resource('phui-object-box-css'); 195 194 196 195 $header = $this->header; 196 + 197 197 if ($this->headerText) { 198 198 $header = id(new PHUIHeaderView()) 199 199 ->setHeader($this->headerText); ··· 201 201 202 202 $showhide = null; 203 203 if ($this->showAction !== null) { 204 + if (!$header) { 205 + $header = id(new PHUIHeaderView()); 206 + } 207 + 204 208 Javelin::initBehavior('phabricator-reveal-content'); 205 209 206 210 $hide_action_id = celerity_generate_unique_node_id();