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

When a custom logo is configured but has a restrictive visibility policy, fall back to the default logo

Summary: Fixes T11982. Currently, configuring a custom logo and then setting the policy restrictively locks off the whole install.

Test Plan:
- Configured `ui.logo`.
- Searched for the file PHID in global search to find the underlying file.
- Set the policy to something restrictive ("only me").
- Purged cache (`bin/cache purge --purge-all`).
- Restarted webserver to nuke APC.
- Loaded a page as a different user.
- Before change: policy exception while trying to load the logo.
- After change: fallback to default logo.
- Loaded page as user who can see the logo, got custom logo.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T11982

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

+12 -5
+12 -5
src/view/page/menu/PhabricatorMainMenuView.php
··· 317 317 318 318 $logo_uri = $cache->getKey($cache_key_logo); 319 319 if (!$logo_uri) { 320 - $file = id(new PhabricatorFileQuery()) 320 + // NOTE: If the file policy has been changed to be restrictive, we'll 321 + // miss here and just show the default logo. The cache will fill later 322 + // when someone who can see the file loads the page. This might be a 323 + // little spooky, see T11982. 324 + $files = id(new PhabricatorFileQuery()) 321 325 ->setViewer($this->getViewer()) 322 326 ->withPHIDs(array($custom_header)) 323 - ->executeOne(); 327 + ->execute(); 328 + $file = head($files); 324 329 if ($file) { 325 330 $logo_uri = $file->getViewURI(); 326 331 $cache->setKey($cache_key_logo, $logo_uri); 327 332 } 328 333 } 329 334 330 - $logo_style[] = 'background-size: 40px 40px;'; 331 - $logo_style[] = 'background-position: 0 0;'; 332 - $logo_style[] = 'background-image: url('.$logo_uri.')'; 335 + if ($logo_uri) { 336 + $logo_style[] = 'background-size: 40px 40px;'; 337 + $logo_style[] = 'background-position: 0 0;'; 338 + $logo_style[] = 'background-image: url('.$logo_uri.')'; 339 + } 333 340 } 334 341 335 342 $logo_node = phutil_tag(