Fix some account profile image derps
Summary: Ref T1536. Several derps here.
Test Plan:
Oh hey this works now:
{F46610}
Reviewers: chad, btrahan
Reviewed By: chad
CC: aran
Maniphest Tasks: T1536
Differential Revision: https://secure.phabricator.com/D6211
This commit is contained in:
@@ -150,12 +150,15 @@ abstract class PhabricatorAuthProvider {
|
|||||||
// PhabricatorFile right now. The storage will get shared, so the impact
|
// PhabricatorFile right now. The storage will get shared, so the impact
|
||||||
// here is negligible.
|
// here is negligible.
|
||||||
|
|
||||||
$image_uri = $account->getAccountImageURI();
|
$image_uri = $adapter->getAccountImageURI();
|
||||||
|
|
||||||
|
$unguarded = AphrontWriteGuard::beginScopedUnguardedWrites();
|
||||||
$image_file = PhabricatorFile::newFromFileDownload(
|
$image_file = PhabricatorFile::newFromFileDownload(
|
||||||
$image_uri,
|
$image_uri,
|
||||||
array(
|
array(
|
||||||
'name' => $name,
|
'name' => $name,
|
||||||
));
|
));
|
||||||
|
unset($unguarded);
|
||||||
|
|
||||||
$account->setProfileImagePHID($image_file->getPHID());
|
$account->setProfileImagePHID($image_file->getPHID());
|
||||||
} catch (Exception $ex) {
|
} catch (Exception $ex) {
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ final class PhabricatorAuthAccountView extends AphrontView {
|
|||||||
$image_uri = PhabricatorUser::getDefaultProfileImageURI();
|
$image_uri = PhabricatorUser::getDefaultProfileImageURI();
|
||||||
if ($account->getProfileImagePHID()) {
|
if ($account->getProfileImagePHID()) {
|
||||||
$image = id(new PhabricatorFileQuery())
|
$image = id(new PhabricatorFileQuery())
|
||||||
->setUser(PhabricatorUser::getOmnipotentUser())
|
->setViewer(PhabricatorUser::getOmnipotentUser())
|
||||||
->withPHIDs(array($account->getProfileImagePHID()))
|
->withPHIDs(array($account->getProfileImagePHID()))
|
||||||
->executeOne();
|
->executeOne();
|
||||||
if ($image) {
|
if ($image) {
|
||||||
|
|||||||
Reference in New Issue
Block a user