Page MenuHomePhabricator

D14576.id35267.diff
No OneTemporary

D14576.id35267.diff

diff --git a/src/applications/maniphest/conduit/ManiphestConduitAPIMethod.php b/src/applications/maniphest/conduit/ManiphestConduitAPIMethod.php
--- a/src/applications/maniphest/conduit/ManiphestConduitAPIMethod.php
+++ b/src/applications/maniphest/conduit/ManiphestConduitAPIMethod.php
@@ -192,20 +192,6 @@
return;
}
- $event = new PhabricatorEvent(
- PhabricatorEventType::TYPE_MANIPHEST_WILLEDITTASK,
- array(
- 'task' => $task,
- 'new' => $is_new,
- 'transactions' => $transactions,
- ));
- $event->setUser($request->getUser());
- $event->setConduitRequest($request);
- PhutilEventEngine::dispatchEvent($event);
-
- $task = $event->getValue('task');
- $transactions = $event->getValue('transactions');
-
$content_source = PhabricatorContentSource::newForSource(
PhabricatorContentSource::SOURCE_CONDUIT,
array());
@@ -221,17 +207,6 @@
$editor->applyTransactions($task, $transactions);
- $event = new PhabricatorEvent(
- PhabricatorEventType::TYPE_MANIPHEST_DIDEDITTASK,
- array(
- 'task' => $task,
- 'new' => $is_new,
- 'transactions' => $transactions,
- ));
- $event->setUser($request->getUser());
- $event->setConduitRequest($request);
- PhutilEventEngine::dispatchEvent($event);
-
// reload the task now that we've done all the fun stuff
return id(new ManiphestTaskQuery())
->setViewer($request->getUser())
diff --git a/src/applications/maniphest/controller/ManiphestTaskEditController.php b/src/applications/maniphest/controller/ManiphestTaskEditController.php
--- a/src/applications/maniphest/controller/ManiphestTaskEditController.php
+++ b/src/applications/maniphest/controller/ManiphestTaskEditController.php
@@ -315,41 +315,13 @@
}
if ($transactions) {
- $is_new = !$task->getID();
-
- $event = new PhabricatorEvent(
- PhabricatorEventType::TYPE_MANIPHEST_WILLEDITTASK,
- array(
- 'task' => $task,
- 'new' => $is_new,
- 'transactions' => $transactions,
- ));
- $event->setUser($viewer);
- $event->setAphrontRequest($request);
- PhutilEventEngine::dispatchEvent($event);
-
- $task = $event->getValue('task');
- $transactions = $event->getValue('transactions');
-
$editor = id(new ManiphestTransactionEditor())
->setActor($viewer)
->setContentSourceFromRequest($request)
->setContinueOnNoEffect(true)
->applyTransactions($task, $transactions);
-
- $event = new PhabricatorEvent(
- PhabricatorEventType::TYPE_MANIPHEST_DIDEDITTASK,
- array(
- 'task' => $task,
- 'new' => $is_new,
- 'transactions' => $transactions,
- ));
- $event->setUser($viewer);
- $event->setAphrontRequest($request);
- PhutilEventEngine::dispatchEvent($event);
}
-
if ($parent_task) {
// TODO: This should be transactional now.
id(new PhabricatorEdgeEditor())
diff --git a/src/applications/maniphest/controller/ManiphestTransactionSaveController.php b/src/applications/maniphest/controller/ManiphestTransactionSaveController.php
--- a/src/applications/maniphest/controller/ManiphestTransactionSaveController.php
+++ b/src/applications/maniphest/controller/ManiphestTransactionSaveController.php
@@ -156,20 +156,6 @@
->setContent($comments));
}
- $event = new PhabricatorEvent(
- PhabricatorEventType::TYPE_MANIPHEST_WILLEDITTASK,
- array(
- 'task' => $task,
- 'new' => false,
- 'transactions' => $transactions,
- ));
- $event->setUser($viewer);
- $event->setAphrontRequest($request);
- PhutilEventEngine::dispatchEvent($event);
-
- $task = $event->getValue('task');
- $transactions = $event->getValue('transactions');
-
$editor = id(new ManiphestTransactionEditor())
->setActor($viewer)
->setContentSourceFromRequest($request)
@@ -192,17 +178,6 @@
$draft->delete();
}
- $event = new PhabricatorEvent(
- PhabricatorEventType::TYPE_MANIPHEST_DIDEDITTASK,
- array(
- 'task' => $task,
- 'new' => false,
- 'transactions' => $transactions,
- ));
- $event->setUser($viewer);
- $event->setAphrontRequest($request);
- PhutilEventEngine::dispatchEvent($event);
-
return id(new AphrontRedirectResponse())->setURI($task_uri);
}
diff --git a/src/docs/user/userguide/events.diviner b/src/docs/user/userguide/events.diviner
--- a/src/docs/user/userguide/events.diviner
+++ b/src/docs/user/userguide/events.diviner
@@ -5,6 +5,10 @@
= Overview =
+(WARNING) The event system is an artifact of a bygone era. Use of the event
+system is strongly discouraged. We have been removing events since 2013 and
+will continue to remove events in the future.
+
Phabricator and Arcanist allow you to install custom runtime event listeners
which can react to certain things happening (like a Maniphest Task being edited
or a user creating a new Differential Revision) and run custom code to perform
@@ -130,42 +134,6 @@
- `specification` Parameters that will be used to invoke the
`differential.createrevision` Conduit call.
-== Maniphest: Will Edit Task ==
-
-The constant for this event is
-`PhabricatorEventType::TYPE_MANIPHEST_WILLEDITTASK`.
-
-This event is dispatched before a task is edited, and allows you to respond to
-or alter the edit. Data available on this event:
-
- - `task` The @{class:ManiphestTask} being edited.
- - `transactions` The list of edits (objects of class
- @{class:ManiphestTransaction}) being applied.
- - `new` A boolean indicating if this task is being created.
- - `mail` If this edit originates from email, the
- @{class:PhabricatorMetaMTAReceivedMail} object.
-
-This is similar to the next event (did edit task) but occurs before the edit
-begins.
-
-== Maniphest: Did Edit Task ==
-
-The constant for this event is
-`PhabricatorEventType::TYPE_MANIPHEST_DIDEDITTASK`.
-
-This event is dispatched after a task is edited, and allows you to react to the
-edit. Data available on this event:
-
- - `task` The @{class:ManiphestTask} that was edited.
- - `transactions` The list of edits (objects of class
- @{class:ManiphestTransaction}) that were applied.
- - `new` A boolean indicating if this task was newly created.
- - `mail` If this edit originates from email, the
- @{class:PhabricatorMetaMTAReceivedMail} object.
-
-This is similar to the previous event (will edit task) but occurs after the
-edit completes.
-
== Differential: Will Mark Generated ==
The constant for this event is
diff --git a/src/infrastructure/events/constant/PhabricatorEventType.php b/src/infrastructure/events/constant/PhabricatorEventType.php
--- a/src/infrastructure/events/constant/PhabricatorEventType.php
+++ b/src/infrastructure/events/constant/PhabricatorEventType.php
@@ -6,9 +6,6 @@
*/
final class PhabricatorEventType extends PhutilEventType {
- const TYPE_MANIPHEST_WILLEDITTASK = 'maniphest.willEditTask';
- const TYPE_MANIPHEST_DIDEDITTASK = 'maniphest.didEditTask';
-
const TYPE_DIFFERENTIAL_WILLMARKGENERATED = 'differential.willMarkGenerated';
const TYPE_DIFFUSION_DIDDISCOVERCOMMIT = 'diffusion.didDiscoverCommit';

File Metadata

Mime Type
text/plain
Expires
Mon, Feb 24, 12:15 AM (16 h, 41 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7188063
Default Alt Text
D14576.id35267.diff (7 KB)

Event Timeline