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

Don't require an actor in `PhabricatorFile::attachToObject()`

Summary:
Ref T6013. A very long time ago, edges were less clearly low-level infrastructure, and some user-aware stuff got built around edge edits.

This was kind of a mess and I eventually removed it, during or prior to T5245. The big issue was that control flow was really hard to figure out as things went all the way down to the deepest level of infrastructure and then came back up the stack to events and transactions. The new stuff is more top-down and generally seems a lot easier and cleaner.

Consequently, actors are no longer required for edge edits. Remove the parameter.

Test Plan: Poked around; ran unit tests.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley, hach-que

Maniphest Tasks: T6013

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

+9 -15
+1 -3
src/applications/differential/controller/DifferentialRevisionViewController.php
··· 913 913 )); 914 914 915 915 $unguarded = AphrontWriteGuard::beginScopedUnguardedWrites(); 916 - $file->attachToObject( 917 - $this->getRequest()->getUser(), 918 - $revision->getPHID()); 916 + $file->attachToObject($revision->getPHID()); 919 917 unset($unguarded); 920 918 921 919 return $file->getRedirectResponse();
-1
src/applications/diffusion/controller/DiffusionBrowseFileController.php
··· 881 881 882 882 $unguarded = AphrontWriteGuard::beginScopedUnguardedWrites(); 883 883 $file->attachToObject( 884 - $this->getRequest()->getUser(), 885 884 $this->getDiffusionRequest()->getRepository()->getPHID()); 886 885 unset($unguarded); 887 886
+1 -3
src/applications/diffusion/controller/DiffusionCommitController.php
··· 1037 1037 )); 1038 1038 1039 1039 $unguarded = AphrontWriteGuard::beginScopedUnguardedWrites(); 1040 - $file->attachToObject( 1041 - $this->getRequest()->getUser(), 1042 - $drequest->getRepository()->getPHID()); 1040 + $file->attachToObject($drequest->getRepository()->getPHID()); 1043 1041 unset($unguarded); 1044 1042 1045 1043 return $file->getRedirectResponse();
+1 -2
src/applications/files/storage/PhabricatorFile.php
··· 944 944 /** 945 945 * Write the policy edge between this file and some object. 946 946 * 947 - * @param PhabricatorUser Acting user. 948 947 * @param phid Object PHID to attach to. 949 948 * @return this 950 949 */ 951 - public function attachToObject(PhabricatorUser $actor, $phid) { 950 + public function attachToObject($phid) { 952 951 $edge_type = PhabricatorEdgeConfig::TYPE_OBJECT_HAS_FILE; 953 952 954 953 id(new PhabricatorEdgeEditor())
+1 -1
src/applications/files/storage/__tests__/PhabricatorFileTestCase.php
··· 60 60 // Attach the file to the object and test that the association opens a 61 61 // policy exception for the non-author viewer. 62 62 63 - $file->attachToObject($author, $object->getPHID()); 63 + $file->attachToObject($object->getPHID()); 64 64 65 65 // Test the attached file's visibility. 66 66 $this->assertEqual(
+1 -1
src/applications/macro/editor/PhabricatorMacroEditor.php
··· 111 111 112 112 $new_file = idx($files, $new); 113 113 if ($new_file) { 114 - $new_file->attachToObject($this->requireActor(), $object->getPHID()); 114 + $new_file->attachToObject($object->getPHID()); 115 115 } 116 116 break; 117 117 }
+1 -1
src/applications/people/controller/PhabricatorPeopleProfilePictureController.php
··· 83 83 $user->setProfileImagePHID(null); 84 84 } else { 85 85 $user->setProfileImagePHID($xformed->getPHID()); 86 - $xformed->attachToObject($viewer, $user->getPHID()); 86 + $xformed->attachToObject($user->getPHID()); 87 87 } 88 88 $user->save(); 89 89 return id(new AphrontRedirectResponse())->setURI($profile_uri);
+1 -1
src/applications/phragment/controller/PhragmentPatchController.php
··· 94 94 )); 95 95 96 96 $unguarded = AphrontWriteGuard::beginScopedUnguardedWrites(); 97 - $result->attachToObject($viewer, $version_b->getFragmentPHID()); 97 + $result->attachToObject($version_b->getFragmentPHID()); 98 98 unset($unguarded); 99 99 100 100 return id(new AphrontRedirectResponse())
+1 -1
src/applications/phragment/controller/PhragmentZIPController.php
··· 114 114 )); 115 115 116 116 $unguarded = AphrontWriteGuard::beginScopedUnguardedWrites(); 117 - $file->attachToObject($viewer, $fragment->getPHID()); 117 + $file->attachToObject($fragment->getPHID()); 118 118 unset($unguarded); 119 119 120 120 $return = $fragment->getURI();
+1 -1
src/applications/phragment/storage/PhragmentFragment.php
··· 119 119 $this->save(); 120 120 $this->saveTransaction(); 121 121 122 - $file->attachToObject($viewer, $version->getPHID()); 122 + $file->attachToObject($version->getPHID()); 123 123 } 124 124 125 125 /**