diff --git a/src/applications/feed/story/base/PhabricatorFeedStory.php b/src/applications/feed/story/base/PhabricatorFeedStory.php
index a6828d16c5..7cdb665dee 100644
--- a/src/applications/feed/story/base/PhabricatorFeedStory.php
+++ b/src/applications/feed/story/base/PhabricatorFeedStory.php
@@ -51,6 +51,20 @@ abstract class PhabricatorFeedStory {
return $this->handles;
}
+ final protected function getHandle($phid) {
+ if (isset($this->handles[$phid])) {
+ if ($this->handles[$phid] instanceof PhabricatorObjectHandle) {
+ return $this->handles[$phid];
+ }
+ }
+
+ $handle = new PhabricatorObjectHandle();
+ $handle->setPHID($phid);
+ $handle->setName("Unloaded Object '{$phid}'");
+
+ return $handle;
+ }
+
final protected function getObjects() {
return $this->objects;
}
diff --git a/src/applications/feed/story/maniphest/PhabricatorFeedStoryManiphest.php b/src/applications/feed/story/maniphest/PhabricatorFeedStoryManiphest.php
index a5a45a52e4..91265a9d9c 100644
--- a/src/applications/feed/story/maniphest/PhabricatorFeedStoryManiphest.php
+++ b/src/applications/feed/story/maniphest/PhabricatorFeedStoryManiphest.php
@@ -20,11 +20,12 @@ class PhabricatorFeedStoryManiphest extends PhabricatorFeedStory {
public function getRequiredHandlePHIDs() {
$data = $this->getStoryData();
- return array(
- $this->getStoryData()->getAuthorPHID(),
- $data->getValue('taskPHID'),
- $data->getValue('ownerPHID'),
- );
+ return array_filter(
+ array(
+ $this->getStoryData()->getAuthorPHID(),
+ $data->getValue('taskPHID'),
+ $data->getValue('ownerPHID'),
+ ));
}
public function getRequiredObjectPHIDs() {
@@ -36,7 +37,6 @@ class PhabricatorFeedStoryManiphest extends PhabricatorFeedStory {
public function renderView() {
$data = $this->getStoryData();
- $handles = $this->getHandles();
$author_phid = $data->getAuthorPHID();
$owner_phid = $data->getValue('ownerPHID');
$task_phid = $data->getValue('taskPHID');
@@ -47,18 +47,27 @@ class PhabricatorFeedStoryManiphest extends PhabricatorFeedStory {
$view = new PhabricatorFeedStoryView();
$verb = ManiphestAction::getActionPastTenseVerb($action);
- $title =
- ''.$handles[$author_phid]->renderLink().''.
- " {$verb} task ".
- ''.$handles[$task_phid]->renderLink().'';
+ $extra = null;
switch ($action) {
case ManiphestAction::ACTION_ASSIGN:
- $title .=
- ' to '.
- ''.$handles[$owner_phid]->renderLink().'';
+ if ($owner_phid) {
+ $extra =
+ ' to '.
+ ''.$this->getHandle($owner_phid)->renderLink().'';
+ } else {
+ $verb = 'placed';
+ $extra = ' up for grabs';
+ }
break;
}
+
+ $title =
+ ''.$this->getHandle($author_phid)->renderLink().''.
+ " {$verb} task ".
+ ''.$this->getHandle($task_phid)->renderLink().'';
+ $title .= $extra;
$title .= '.';
+
$view->setTitle($title);
switch ($action) {
diff --git a/src/applications/metamta/controller/base/PhabricatorMetaMTAController.php b/src/applications/metamta/controller/base/PhabricatorMetaMTAController.php
index 76d3214649..80d2f2e8f3 100644
--- a/src/applications/metamta/controller/base/PhabricatorMetaMTAController.php
+++ b/src/applications/metamta/controller/base/PhabricatorMetaMTAController.php
@@ -18,6 +18,10 @@
abstract class PhabricatorMetaMTAController extends PhabricatorController {
+ public function shouldRequireAdmin() {
+ return true;
+ }
+
public function buildStandardPageResponse($view, array $data) {
$page = $this->buildStandardPageView();
diff --git a/src/applications/metamta/controller/list/PhabricatorMetaMTAListController.php b/src/applications/metamta/controller/list/PhabricatorMetaMTAListController.php
index 14904c65b1..96701fa606 100644
--- a/src/applications/metamta/controller/list/PhabricatorMetaMTAListController.php
+++ b/src/applications/metamta/controller/list/PhabricatorMetaMTAListController.php
@@ -100,7 +100,9 @@ class PhabricatorMetaMTAListController extends PhabricatorMetaMTAController {
$panel = new AphrontPanelView();
$panel->appendChild($table);
$panel->setHeader('MetaMTA Messages');
- $panel->setCreateButton('Send New Message', '/mail/send/');
+ if ($user->getIsAdmin()) {
+ $panel->setCreateButton('Send New Test Message', '/mail/send/');
+ }
$panel->appendChild($pager);
return $this->buildStandardPageResponse(
diff --git a/src/applications/metamta/controller/view/PhabricatorMetaMTAViewController.php b/src/applications/metamta/controller/view/PhabricatorMetaMTAViewController.php
index 627cf6ae36..2aecc5d665 100644
--- a/src/applications/metamta/controller/view/PhabricatorMetaMTAViewController.php
+++ b/src/applications/metamta/controller/view/PhabricatorMetaMTAViewController.php
@@ -60,10 +60,6 @@ class PhabricatorMetaMTAViewController extends PhabricatorMetaMTAController {
id(new AphrontFormStaticControl())
->setLabel('Related PHID')
->setValue($mail->getRelatedPHID()))
- ->appendChild(
- id(new AphrontFormTextAreaControl())
- ->setLabel('Parameters')
- ->setValue(json_encode($mail->getParameters())))
->appendChild(
id(new AphrontFormSubmitControl())
->addCancelButton('/mail/', 'Done'));
diff --git a/src/applications/metamta/controller/view/__init__.php b/src/applications/metamta/controller/view/__init__.php
index d08f948405..be2cda3818 100644
--- a/src/applications/metamta/controller/view/__init__.php
+++ b/src/applications/metamta/controller/view/__init__.php
@@ -12,7 +12,6 @@ phutil_require_module('phabricator', 'applications/metamta/storage/mail');
phutil_require_module('phabricator', 'view/form/base');
phutil_require_module('phabricator', 'view/form/control/static');
phutil_require_module('phabricator', 'view/form/control/submit');
-phutil_require_module('phabricator', 'view/form/control/textarea');
phutil_require_module('phabricator', 'view/layout/panel');
phutil_require_module('phabricator', 'view/utils');