1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-19 05:12:41 +01:00

Remove all setObjectURI() from ActionListViews

Summary:
Ref T10004. After D14804, we get this behavior by default and no longer need to set it explicitly.

(If some endpoint did eventually need to set it explicitly, it could just change what it passes to `setHref()`, but I believe we currently have no such endpoints and do not foresee ever having any.)

Test Plan:
  - As a logged out user, clicked various links in Differential, Maniphest, Files, etc., always got redirected to a sensible place after login.
  - Grepped for `setObjectURI()`, `getObjectURI()` (there are a few remaining callsites, but to a different method with the same name in Doorkeeper).

Reviewers: chad

Reviewed By: chad

Subscribers: hach-que

Maniphest Tasks: T10004

Differential Revision: https://secure.phabricator.com/D14805
This commit is contained in:
epriestley 2015-12-17 06:31:33 -08:00
parent e869e7df0b
commit 2868a69f65
49 changed files with 22 additions and 111 deletions

View file

@ -152,7 +152,6 @@ final class PhabricatorCalendarEventViewController
$is_attending = $event->getIsUserAttending($viewer->getPHID()); $is_attending = $event->getIsUserAttending($viewer->getPHID());
$actions = id(new PhabricatorActionListView()) $actions = id(new PhabricatorActionListView())
->setObjectURI($this->getApplicationURI('event/'.$id.'/'))
->setUser($viewer) ->setUser($viewer)
->setObject($event); ->setObject($event);

View file

@ -99,7 +99,6 @@ final class PhabricatorDashboardManageController
$id = $dashboard->getID(); $id = $dashboard->getID();
$actions = id(new PhabricatorActionListView()) $actions = id(new PhabricatorActionListView())
->setObjectURI($this->getApplicationURI('view/'.$dashboard->getID().'/'))
->setObject($dashboard) ->setObject($dashboard)
->setUser($viewer); ->setUser($viewer);

View file

@ -84,7 +84,6 @@ final class PhabricatorDashboardPanelViewController
$id = $panel->getID(); $id = $panel->getID();
$actions = id(new PhabricatorActionListView()) $actions = id(new PhabricatorActionListView())
->setObjectURI('/'.$panel->getMonogram())
->setObject($panel) ->setObject($panel)
->setUser($viewer); ->setUser($viewer);

View file

@ -63,8 +63,7 @@ final class DifferentialRevisionDetailView extends AphrontView {
$actions = id(new PhabricatorActionListView()) $actions = id(new PhabricatorActionListView())
->setUser($user) ->setUser($user)
->setObject($revision) ->setObject($revision);
->setObjectURI($this->getURI());
foreach ($this->getActions() as $action) { foreach ($this->getActions() as $action) {
$actions->addAction($action); $actions->addAction($action);
} }

View file

@ -903,8 +903,7 @@ final class DiffusionCommitController extends DiffusionController {
$actions = id(new PhabricatorActionListView()) $actions = id(new PhabricatorActionListView())
->setUser($user) ->setUser($user)
->setObject($commit) ->setObject($commit);
->setObjectURI($request->getRequestURI());
$can_edit = PhabricatorPolicyFilter::hasCapability( $can_edit = PhabricatorPolicyFilter::hasCapability(
$user, $user,

View file

@ -480,13 +480,11 @@ final class DiffusionRepositoryController extends DiffusionController {
private function buildActionList(PhabricatorRepository $repository) { private function buildActionList(PhabricatorRepository $repository) {
$viewer = $this->getRequest()->getUser(); $viewer = $this->getRequest()->getUser();
$view_uri = $this->getApplicationURI($repository->getCallsign().'/');
$edit_uri = $this->getApplicationURI($repository->getCallsign().'/edit/'); $edit_uri = $this->getApplicationURI($repository->getCallsign().'/edit/');
$view = id(new PhabricatorActionListView()) $view = id(new PhabricatorActionListView())
->setUser($viewer) ->setUser($viewer)
->setObject($repository) ->setObject($repository);
->setObjectURI($view_uri);
$can_edit = PhabricatorPolicyFilter::hasCapability( $can_edit = PhabricatorPolicyFilter::hasCapability(
$viewer, $viewer,

View file

@ -224,7 +224,6 @@ final class DiffusionRepositoryEditMainController
$viewer = $this->getRequest()->getUser(); $viewer = $this->getRequest()->getUser();
$view = id(new PhabricatorActionListView()) $view = id(new PhabricatorActionListView())
->setObjectURI($this->getRequest()->getRequestURI())
->setUser($viewer); ->setUser($viewer);
$edit = id(new PhabricatorActionView()) $edit = id(new PhabricatorActionView())
@ -327,7 +326,6 @@ final class DiffusionRepositoryEditMainController
$viewer = $this->getRequest()->getUser(); $viewer = $this->getRequest()->getUser();
$view = id(new PhabricatorActionListView()) $view = id(new PhabricatorActionListView())
->setObjectURI($this->getRequest()->getRequestURI())
->setUser($viewer); ->setUser($viewer);
$edit = id(new PhabricatorActionView()) $edit = id(new PhabricatorActionView())
@ -364,7 +362,6 @@ final class DiffusionRepositoryEditMainController
$viewer = $this->getRequest()->getUser(); $viewer = $this->getRequest()->getUser();
$view = id(new PhabricatorActionListView()) $view = id(new PhabricatorActionListView())
->setObjectURI($this->getRequest()->getRequestURI())
->setUser($viewer); ->setUser($viewer);
$edit = id(new PhabricatorActionView()) $edit = id(new PhabricatorActionView())
@ -419,7 +416,6 @@ final class DiffusionRepositoryEditMainController
$viewer = $this->getRequest()->getUser(); $viewer = $this->getRequest()->getUser();
$view = id(new PhabricatorActionListView()) $view = id(new PhabricatorActionListView())
->setObjectURI($this->getRequest()->getRequestURI())
->setUser($viewer); ->setUser($viewer);
$edit = id(new PhabricatorActionView()) $edit = id(new PhabricatorActionView())
@ -469,7 +465,6 @@ final class DiffusionRepositoryEditMainController
$viewer = $this->getRequest()->getUser(); $viewer = $this->getRequest()->getUser();
$view = id(new PhabricatorActionListView()) $view = id(new PhabricatorActionListView())
->setObjectURI($this->getRequest()->getRequestURI())
->setUser($viewer); ->setUser($viewer);
$edit = id(new PhabricatorActionView()) $edit = id(new PhabricatorActionView())
@ -509,7 +504,6 @@ final class DiffusionRepositoryEditMainController
$viewer = $this->getRequest()->getUser(); $viewer = $this->getRequest()->getUser();
$view = id(new PhabricatorActionListView()) $view = id(new PhabricatorActionListView())
->setObjectURI($this->getRequest()->getRequestURI())
->setUser($viewer); ->setUser($viewer);
$edit = id(new PhabricatorActionView()) $edit = id(new PhabricatorActionView())
@ -551,7 +545,6 @@ final class DiffusionRepositoryEditMainController
$viewer = $this->getRequest()->getUser(); $viewer = $this->getRequest()->getUser();
$view = id(new PhabricatorActionListView()) $view = id(new PhabricatorActionListView())
->setObjectURI($this->getRequest()->getRequestURI())
->setUser($viewer); ->setUser($viewer);
$edit = id(new PhabricatorActionView()) $edit = id(new PhabricatorActionView())
@ -592,7 +585,6 @@ final class DiffusionRepositoryEditMainController
$viewer = $this->getRequest()->getUser(); $viewer = $this->getRequest()->getUser();
$view = id(new PhabricatorActionListView()) $view = id(new PhabricatorActionListView())
->setObjectURI($this->getRequest()->getRequestURI())
->setUser($viewer); ->setUser($viewer);
$edit = id(new PhabricatorActionView()) $edit = id(new PhabricatorActionView())
@ -640,7 +632,6 @@ final class DiffusionRepositoryEditMainController
$viewer = $this->getViewer(); $viewer = $this->getViewer();
$view = id(new PhabricatorActionListView()) $view = id(new PhabricatorActionListView())
->setObjectURI($this->getRequest()->getRequestURI())
->setUser($viewer); ->setUser($viewer);
$edit = id(new PhabricatorActionView()) $edit = id(new PhabricatorActionView())
@ -678,7 +669,6 @@ final class DiffusionRepositoryEditMainController
$viewer = $this->getViewer(); $viewer = $this->getViewer();
$view = id(new PhabricatorActionListView()) $view = id(new PhabricatorActionListView())
->setObjectURI($this->getRequest()->getRequestURI())
->setUser($viewer); ->setUser($viewer);
$edit = id(new PhabricatorActionView()) $edit = id(new PhabricatorActionView())
@ -732,7 +722,6 @@ final class DiffusionRepositoryEditMainController
$user = $this->getRequest()->getUser(); $user = $this->getRequest()->getUser();
$view = id(new PhabricatorActionListView()) $view = id(new PhabricatorActionListView())
->setObjectURI($this->getRequest()->getRequestURI())
->setUser($user); ->setUser($user);
$edit = id(new PhabricatorActionView()) $edit = id(new PhabricatorActionView())
@ -1240,7 +1229,6 @@ final class DiffusionRepositoryEditMainController
$viewer = $this->getRequest()->getUser(); $viewer = $this->getRequest()->getUser();
$mirror_actions = id(new PhabricatorActionListView()) $mirror_actions = id(new PhabricatorActionListView())
->setObjectURI($this->getRequest()->getRequestURI())
->setUser($viewer); ->setUser($viewer);
$new_mirror_uri = $this->getRepositoryControllerURI( $new_mirror_uri = $this->getRepositoryControllerURI(
@ -1319,7 +1307,6 @@ final class DiffusionRepositoryEditMainController
$viewer = $this->getRequest()->getUser(); $viewer = $this->getRequest()->getUser();
$view = id(new PhabricatorActionListView()) $view = id(new PhabricatorActionListView())
->setObjectURI($this->getRequest()->getRequestURI())
->setUser($viewer); ->setUser($viewer);
$edit = id(new PhabricatorActionView()) $edit = id(new PhabricatorActionView())

View file

@ -125,8 +125,7 @@ final class DivinerBookController extends DivinerController {
$action_view = id(new PhabricatorActionListView()) $action_view = id(new PhabricatorActionListView())
->setUser($user) ->setUser($user)
->setObject($book) ->setObject($book);
->setObjectURI($this->getRequest()->getRequestURI());
$action_view->addAction( $action_view->addAction(
id(new PhabricatorActionView()) id(new PhabricatorActionView())

View file

@ -67,7 +67,6 @@ final class DrydockAuthorizationViewController
$view = id(new PhabricatorActionListView()) $view = id(new PhabricatorActionListView())
->setUser($viewer) ->setUser($viewer)
->setObjectURI($this->getRequest()->getRequestURI())
->setObject($authorization); ->setObject($authorization);
$can_edit = PhabricatorPolicyFilter::hasCapability( $can_edit = PhabricatorPolicyFilter::hasCapability(

View file

@ -86,7 +86,6 @@ final class DrydockBlueprintViewController extends DrydockBlueprintController {
$view = id(new PhabricatorActionListView()) $view = id(new PhabricatorActionListView())
->setUser($viewer) ->setUser($viewer)
->setObjectURI($this->getRequest()->getRequestURI())
->setObject($blueprint); ->setObject($blueprint);
$edit_uri = $this->getApplicationURI("blueprint/edit/{$id}/"); $edit_uri = $this->getApplicationURI("blueprint/edit/{$id}/");

View file

@ -66,7 +66,6 @@ final class DrydockLeaseViewController extends DrydockLeaseController {
$view = id(new PhabricatorActionListView()) $view = id(new PhabricatorActionListView())
->setUser($viewer) ->setUser($viewer)
->setObjectURI($this->getRequest()->getRequestURI())
->setObject($lease); ->setObject($lease);
$id = $lease->getID(); $id = $lease->getID();

View file

@ -68,7 +68,6 @@ final class DrydockRepositoryOperationViewController
$view = id(new PhabricatorActionListView()) $view = id(new PhabricatorActionListView())
->setUser($viewer) ->setUser($viewer)
->setObjectURI($this->getRequest()->getRequestURI())
->setObject($operation); ->setObject($operation);
return $view; return $view;

View file

@ -74,7 +74,6 @@ final class DrydockResourceViewController extends DrydockResourceController {
$view = id(new PhabricatorActionListView()) $view = id(new PhabricatorActionListView())
->setUser($viewer) ->setUser($viewer)
->setObjectURI($this->getRequest()->getRequestURI())
->setObject($resource); ->setObject($resource);
$can_release = $resource->canRelease(); $can_release = $resource->canRelease();

View file

@ -120,7 +120,6 @@ final class PhabricatorFileInfoController extends PhabricatorFileController {
$view = id(new PhabricatorActionListView()) $view = id(new PhabricatorActionListView())
->setUser($viewer) ->setUser($viewer)
->setObjectURI($this->getRequest()->getRequestURI())
->setObject($file); ->setObject($file);
$can_download = !$file->getIsPartial(); $can_download = !$file->getIsPartial();

View file

@ -445,8 +445,7 @@ final class HarbormasterBuildViewController
$list = id(new PhabricatorActionListView()) $list = id(new PhabricatorActionListView())
->setUser($viewer) ->setUser($viewer)
->setObject($build) ->setObject($build);
->setObjectURI("/build/{$id}");
$can_restart = $build->canRestartBuild(); $can_restart = $build->canRestartBuild();
$can_pause = $build->canPauseBuild(); $can_pause = $build->canPauseBuild();

View file

@ -74,8 +74,7 @@ final class HarbormasterBuildableViewController
$list = id(new PhabricatorActionListView()) $list = id(new PhabricatorActionListView())
->setUser($viewer) ->setUser($viewer)
->setObject($buildable) ->setObject($buildable);
->setObjectURI($buildable->getMonogram());
$can_edit = PhabricatorPolicyFilter::hasCapability( $can_edit = PhabricatorPolicyFilter::hasCapability(
$viewer, $viewer,

View file

@ -221,8 +221,7 @@ final class HarbormasterPlanViewController extends HarbormasterPlanController {
$list = id(new PhabricatorActionListView()) $list = id(new PhabricatorActionListView())
->setUser($viewer) ->setUser($viewer)
->setObject($plan) ->setObject($plan);
->setObjectURI($this->getApplicationURI("plan/{$id}/"));
$can_edit = PhabricatorPolicyFilter::hasCapability( $can_edit = PhabricatorPolicyFilter::hasCapability(
$viewer, $viewer,

View file

@ -67,8 +67,7 @@ final class HeraldRuleViewController extends HeraldController {
$view = id(new PhabricatorActionListView()) $view = id(new PhabricatorActionListView())
->setUser($viewer) ->setUser($viewer)
->setObject($rule) ->setObject($rule);
->setObjectURI('/'.$rule->getMonogram());
$can_edit = PhabricatorPolicyFilter::hasCapability( $can_edit = PhabricatorPolicyFilter::hasCapability(
$viewer, $viewer,

View file

@ -98,7 +98,6 @@ final class LegalpadDocumentManageController extends LegalpadController {
$actions = id(new PhabricatorActionListView()) $actions = id(new PhabricatorActionListView())
->setUser($viewer) ->setUser($viewer)
->setObjectURI($this->getRequest()->getRequestURI())
->setObject($document); ->setObject($document);
$can_edit = PhabricatorPolicyFilter::hasCapability( $can_edit = PhabricatorPolicyFilter::hasCapability(

View file

@ -104,7 +104,6 @@ final class PhabricatorMacroViewController
$view = id(new PhabricatorActionListView()) $view = id(new PhabricatorActionListView())
->setUser($request->getUser()) ->setUser($request->getUser())
->setObject($macro) ->setObject($macro)
->setObjectURI($request->getRequestURI())
->addAction( ->addAction(
id(new PhabricatorActionView()) id(new PhabricatorActionView())
->setName(pht('Edit Macro')) ->setName(pht('Edit Macro'))

View file

@ -136,8 +136,7 @@ final class ManiphestTaskDetailController extends ManiphestController {
$view = id(new PhabricatorActionListView()) $view = id(new PhabricatorActionListView())
->setUser($viewer) ->setUser($viewer)
->setObject($task) ->setObject($task);
->setObjectURI($this->getRequest()->getRequestURI());
$view->addAction( $view->addAction(
id(new PhabricatorActionView()) id(new PhabricatorActionView())

View file

@ -135,8 +135,7 @@ final class PhabricatorApplicationDetailViewController
PhabricatorApplication $selected) { PhabricatorApplication $selected) {
$view = id(new PhabricatorActionListView()) $view = id(new PhabricatorActionListView())
->setUser($user) ->setUser($user);
->setObjectURI($this->getRequest()->getRequestURI());
$can_edit = PhabricatorPolicyFilter::hasCapability( $can_edit = PhabricatorPolicyFilter::hasCapability(
$user, $user,

View file

@ -59,7 +59,6 @@ final class NuanceQueueViewController extends NuanceController {
$id = $queue->getID(); $id = $queue->getID();
$actions = id(new PhabricatorActionListView()) $actions = id(new PhabricatorActionListView())
->setObjectURI($queue->getURI())
->setUser($viewer); ->setUser($viewer);
$can_edit = PhabricatorPolicyFilter::hasCapability( $can_edit = PhabricatorPolicyFilter::hasCapability(

View file

@ -80,7 +80,6 @@ final class NuanceSourceViewController extends NuanceController {
$id = $source->getID(); $id = $source->getID();
$actions = id(new PhabricatorActionListView()) $actions = id(new PhabricatorActionListView())
->setObjectURI($source->getURI())
->setUser($viewer); ->setUser($viewer);
$can_edit = PhabricatorPolicyFilter::hasCapability( $can_edit = PhabricatorPolicyFilter::hasCapability(

View file

@ -89,7 +89,6 @@ final class PassphraseCredentialViewController extends PassphraseController {
} }
$actions = id(new PhabricatorActionListView()) $actions = id(new PhabricatorActionListView())
->setObjectURI('/K'.$id)
->setObject($credential) ->setObject($credential)
->setUser($viewer); ->setUser($viewer);

View file

@ -131,8 +131,7 @@ final class PhabricatorPasteViewController extends PhabricatorPasteController {
$action_list = id(new PhabricatorActionListView()) $action_list = id(new PhabricatorActionListView())
->setUser($viewer) ->setUser($viewer)
->setObject($paste) ->setObject($paste);
->setObjectURI($this->getRequest()->getRequestURI());
$action_list->addAction( $action_list->addAction(
id(new PhabricatorActionView()) id(new PhabricatorActionView())

View file

@ -43,7 +43,6 @@ final class PhabricatorPeopleProfileController
$actions = id(new PhabricatorActionListView()) $actions = id(new PhabricatorActionListView())
->setObject($user) ->setObject($user)
->setObjectURI($this->getRequest()->getRequestURI())
->setUser($viewer); ->setUser($viewer);
$can_edit = PhabricatorPolicyFilter::hasCapability( $can_edit = PhabricatorPolicyFilter::hasCapability(

View file

@ -134,7 +134,6 @@ final class PhameBlogManageController extends PhameBlogController {
private function renderActions(PhameBlog $blog, PhabricatorUser $viewer) { private function renderActions(PhameBlog $blog, PhabricatorUser $viewer) {
$actions = id(new PhabricatorActionListView()) $actions = id(new PhabricatorActionListView())
->setObject($blog) ->setObject($blog)
->setObjectURI($this->getRequest()->getRequestURI())
->setUser($viewer); ->setUser($viewer);
$can_edit = PhabricatorPolicyFilter::hasCapability( $can_edit = PhabricatorPolicyFilter::hasCapability(

View file

@ -108,7 +108,6 @@ final class PhameBlogViewController extends PhameLiveController {
$actions = id(new PhabricatorActionListView()) $actions = id(new PhabricatorActionListView())
->setObject($blog) ->setObject($blog)
->setObjectURI($this->getRequest()->getRequestURI())
->setUser($viewer); ->setUser($viewer);
$can_edit = PhabricatorPolicyFilter::hasCapability( $can_edit = PhabricatorPolicyFilter::hasCapability(

View file

@ -155,7 +155,6 @@ final class PhamePostViewController
$actions = id(new PhabricatorActionListView()) $actions = id(new PhabricatorActionListView())
->setObject($post) ->setObject($post)
->setObjectURI($this->getRequest()->getRequestURI())
->setUser($viewer); ->setUser($viewer);
$can_edit = PhabricatorPolicyFilter::hasCapability( $can_edit = PhabricatorPolicyFilter::hasCapability(

View file

@ -28,7 +28,6 @@ final class PhluxViewController extends PhluxController {
$actions = id(new PhabricatorActionListView()) $actions = id(new PhabricatorActionListView())
->setUser($viewer) ->setUser($viewer)
->setObjectURI($request->getRequestURI())
->setObject($var); ->setObject($var);
$can_edit = PhabricatorPolicyFilter::hasCapability( $can_edit = PhabricatorPolicyFilter::hasCapability(

View file

@ -117,7 +117,6 @@ final class PholioMockViewController extends PholioController {
$actions = id(new PhabricatorActionListView()) $actions = id(new PhabricatorActionListView())
->setUser($viewer) ->setUser($viewer)
->setObjectURI($this->getRequest()->getRequestURI())
->setObject($mock); ->setObject($mock);
$can_edit = PhabricatorPolicyFilter::hasCapability( $can_edit = PhabricatorPolicyFilter::hasCapability(

View file

@ -44,7 +44,6 @@ final class PhortuneAccountViewController extends PhortuneController {
$actions = id(new PhabricatorActionListView()) $actions = id(new PhabricatorActionListView())
->setUser($viewer) ->setUser($viewer)
->setObjectURI($request->getRequestURI())
->addAction( ->addAction(
id(new PhabricatorActionView()) id(new PhabricatorActionView())
->setName(pht('Edit Account')) ->setName(pht('Edit Account'))

View file

@ -22,8 +22,7 @@ final class PhortuneProductViewController extends PhortuneController {
$edit_uri = $this->getApplicationURI('product/edit/'.$product->getID().'/'); $edit_uri = $this->getApplicationURI('product/edit/'.$product->getID().'/');
$actions = id(new PhabricatorActionListView()) $actions = id(new PhabricatorActionListView())
->setUser($viewer) ->setUser($viewer);
->setObjectURI($request->getRequestURI());
$crumbs = $this->buildApplicationCrumbs(); $crumbs = $this->buildApplicationCrumbs();
$crumbs->addTextCrumb( $crumbs->addTextCrumb(

View file

@ -38,8 +38,7 @@ final class PhortuneSubscriptionViewController extends PhortuneController {
->setHeader($title); ->setHeader($title);
$actions = id(new PhabricatorActionListView()) $actions = id(new PhabricatorActionListView())
->setUser($viewer) ->setUser($viewer);
->setObjectURI($request->getRequestURI());
$edit_uri = $subscription->getEditURI(); $edit_uri = $subscription->getEditURI();

View file

@ -92,8 +92,7 @@ abstract class PhragmentController extends PhabricatorController {
$actions = id(new PhabricatorActionListView()) $actions = id(new PhabricatorActionListView())
->setUser($viewer) ->setUser($viewer)
->setObject($fragment) ->setObject($fragment);
->setObjectURI($fragment->getURI());
$actions->addAction( $actions->addAction(
id(new PhabricatorActionView()) id(new PhabricatorActionView())
->setName(pht('Download Fragment')) ->setName(pht('Download Fragment'))

View file

@ -106,8 +106,7 @@ final class PhragmentSnapshotViewController extends PhragmentController {
$actions = id(new PhabricatorActionListView()) $actions = id(new PhabricatorActionListView())
->setUser($viewer) ->setUser($viewer)
->setObject($snapshot) ->setObject($snapshot);
->setObjectURI($snapshot->getURI());
$actions->addAction( $actions->addAction(
id(new PhabricatorActionView()) id(new PhabricatorActionView())
->setName(pht('Download Snapshot as ZIP')) ->setName(pht('Download Snapshot as ZIP'))

View file

@ -51,8 +51,7 @@ final class PhragmentVersionController extends PhragmentController {
$actions = id(new PhabricatorActionListView()) $actions = id(new PhabricatorActionListView())
->setUser($viewer) ->setUser($viewer)
->setObject($version) ->setObject($version);
->setObjectURI($version->getURI());
$actions->addAction( $actions->addAction(
id(new PhabricatorActionView()) id(new PhabricatorActionView())
->setName(pht('Download Version')) ->setName(pht('Download Version'))

View file

@ -267,7 +267,6 @@ final class PhrictionDocumentController
$action_view = id(new PhabricatorActionListView()) $action_view = id(new PhabricatorActionListView())
->setUser($viewer) ->setUser($viewer)
->setObjectURI($this->getRequest()->getRequestURI())
->setObject($document); ->setObject($document);
if (!$document->getID()) { if (!$document->getID()) {

View file

@ -91,7 +91,6 @@ final class PhabricatorPhurlURLViewController
$id = $url->getID(); $id = $url->getID();
$actions = id(new PhabricatorActionListView()) $actions = id(new PhabricatorActionListView())
->setObjectURI($url->getURI())
->setUser($viewer) ->setUser($viewer)
->setObject($url); ->setObject($url);

View file

@ -143,8 +143,7 @@ final class PonderQuestionViewController extends PonderController {
$view = id(new PhabricatorActionListView()) $view = id(new PhabricatorActionListView())
->setUser($viewer) ->setUser($viewer)
->setObject($question) ->setObject($question);
->setObjectURI($request->getRequestURI());
$view->addAction( $view->addAction(
id(new PhabricatorActionView()) id(new PhabricatorActionView())

View file

@ -168,8 +168,7 @@ final class PonderAnswerView extends AphrontTagView {
$view = id(new PhabricatorActionListView()) $view = id(new PhabricatorActionListView())
->setUser($viewer) ->setUser($viewer)
->setObject($answer) ->setObject($answer);
->setObjectURI('Q'.$answer->getQuestionID());
$user_marked = $answer->getUserVote(); $user_marked = $answer->getUserVote();
$can_vote = $viewer->isLoggedIn(); $can_vote = $viewer->isLoggedIn();

View file

@ -83,7 +83,6 @@ final class PhabricatorProjectColumnDetailController
$base_uri = '/board/'.$project_id.'/'; $base_uri = '/board/'.$project_id.'/';
$actions = id(new PhabricatorActionListView()) $actions = id(new PhabricatorActionListView())
->setObjectURI($this->getApplicationURI($base_uri.'column/'.$id.'/'))
->setUser($viewer); ->setUser($viewer);
$can_edit = PhabricatorPolicyFilter::hasCapability( $can_edit = PhabricatorPolicyFilter::hasCapability(

View file

@ -79,8 +79,7 @@ final class PhabricatorProjectProfileController
$view = id(new PhabricatorActionListView()) $view = id(new PhabricatorActionListView())
->setUser($viewer) ->setUser($viewer)
->setObject($project) ->setObject($project);
->setObjectURI($request->getRequestURI());
$can_edit = PhabricatorPolicyFilter::hasCapability( $can_edit = PhabricatorPolicyFilter::hasCapability(
$viewer, $viewer,

View file

@ -87,8 +87,7 @@ final class ReleephBranchViewController extends ReleephBranchController {
$actions = id(new PhabricatorActionListView()) $actions = id(new PhabricatorActionListView())
->setUser($viewer) ->setUser($viewer)
->setObject($branch) ->setObject($branch);
->setObjectURI($this->getRequest()->getRequestURI());
$can_edit = PhabricatorPolicyFilter::hasCapability( $can_edit = PhabricatorPolicyFilter::hasCapability(
$viewer, $viewer,

View file

@ -86,8 +86,7 @@ final class ReleephProductViewController extends ReleephProductController {
$actions = id(new PhabricatorActionListView()) $actions = id(new PhabricatorActionListView())
->setUser($viewer) ->setUser($viewer)
->setObject($product) ->setObject($product);
->setObjectURI($this->getRequest()->getRequestURI());
$can_edit = PhabricatorPolicyFilter::hasCapability( $can_edit = PhabricatorPolicyFilter::hasCapability(
$viewer, $viewer,

View file

@ -102,8 +102,7 @@ final class PhabricatorSpacesViewController
$viewer = $this->getRequest()->getUser(); $viewer = $this->getRequest()->getUser();
$list = id(new PhabricatorActionListView()) $list = id(new PhabricatorActionListView())
->setUser($viewer) ->setUser($viewer);
->setObjectURI('/'.$space->getMonogram());
$can_edit = PhabricatorPolicyFilter::hasCapability( $can_edit = PhabricatorPolicyFilter::hasCapability(
$viewer, $viewer,

View file

@ -4,7 +4,6 @@ final class PhabricatorActionListView extends AphrontView {
private $actions = array(); private $actions = array();
private $object; private $object;
private $objectURI;
private $id = null; private $id = null;
public function setObject(PhabricatorLiskDAO $object) { public function setObject(PhabricatorLiskDAO $object) {
@ -12,11 +11,6 @@ final class PhabricatorActionListView extends AphrontView {
return $this; return $this;
} }
public function setObjectURI($uri) {
$this->objectURI = $uri;
return $this;
}
public function addAction(PhabricatorActionView $view) { public function addAction(PhabricatorActionView $view) {
$this->actions[] = $view; $this->actions[] = $view;
return $this; return $this;
@ -47,7 +41,6 @@ final class PhabricatorActionListView extends AphrontView {
} }
foreach ($actions as $action) { foreach ($actions as $action) {
$action->setObjectURI($this->objectURI);
$action->setUser($this->user); $action->setUser($this->user);
} }

View file

@ -10,7 +10,6 @@ final class PhabricatorActionView extends AphrontView {
private $workflow; private $workflow;
private $renderAsForm; private $renderAsForm;
private $download; private $download;
private $objectURI;
private $sigils = array(); private $sigils = array();
private $metadata; private $metadata;
private $selected; private $selected;
@ -34,15 +33,6 @@ final class PhabricatorActionView extends AphrontView {
return $this->metadata; return $this->metadata;
} }
public function setObjectURI($object_uri) {
$this->objectURI = $object_uri;
return $this;
}
public function getObjectURI() {
return $this->objectURI;
}
public function setDownload($download) { public function setDownload($download) {
$this->download = $download; $this->download = $download;
return $this; return $this;
@ -62,19 +52,7 @@ final class PhabricatorActionView extends AphrontView {
return $this; return $this;
} }
/**
* If the user is not logged in and the action is relatively complicated,
* give them a generic login link that will re-direct to the page they're
* viewing.
*/
public function getHref() { public function getHref() {
if (($this->workflow || $this->renderAsForm) && !$this->download) {
if (!$this->user || !$this->user->isLoggedIn()) {
return id(new PhutilURI('/auth/start/'))
->setQueryParam('next', (string)$this->getObjectURI());
}
}
return $this->href; return $this->href;
} }