@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 UI for choosing a profile picture when user has no picture

Summary: Currently, we always show "current picture" even if you don't have one. In this case, the first available picture becomes the "current picture". Instead, show "current picture" only if there's actually a current picture to show.

Test Plan: {F49875}

Reviewers: btrahan, chad

Reviewed By: btrahan

CC: aran

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

+9 -5
+9 -5
src/applications/people/controller/PhabricatorPeopleProfilePictureController.php
··· 102 102 $images = array(); 103 103 104 104 $current = $user->getProfileImagePHID(); 105 + $has_current = false; 105 106 if ($current) { 106 107 $files = id(new PhabricatorFileQuery()) 107 108 ->setViewer($viewer) ··· 110 111 if ($files) { 111 112 $file = head($files); 112 113 if ($file->isTransformableImage()) { 114 + $has_current = true; 113 115 $images[$current] = array( 114 116 'uri' => $file->getBestURI(), 115 117 'tip' => pht('Current Picture'), ··· 242 244 $buttons[] = $button; 243 245 } 244 246 245 - $form->appendChild( 246 - id(new AphrontFormMarkupControl()) 247 - ->setLabel(pht('Current Picture')) 248 - ->setValue(array_slice($buttons, 0, 1))); 247 + if ($has_current) { 248 + $form->appendChild( 249 + id(new AphrontFormMarkupControl()) 250 + ->setLabel(pht('Current Picture')) 251 + ->setValue(array_shift($buttons))); 252 + } 249 253 250 254 $form->appendChild( 251 255 id(new AphrontFormMarkupControl()) 252 256 ->setLabel(pht('Use Picture')) 253 - ->setValue(array_slice($buttons, 1))); 257 + ->setValue($buttons)); 254 258 255 259 $upload_head = id(new PhabricatorHeaderView()) 256 260 ->setHeader(pht('Upload New Picture'));