1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-20 13:52:40 +01:00

Remove WILLEDITTASK and DIDEDITTASK events

Summary: Fixes T9851. I'll hold this for a while to give users some time to update per T9860.

Test Plan:
Edited a task via:

  - Conduit
  - Comments field
  - Edit form
  - New task form

Reviewers: chad

Reviewed By: chad

Subscribers: Krenair

Maniphest Tasks: T9851

Differential Revision: https://secure.phabricator.com/D14576
This commit is contained in:
epriestley 2015-11-26 07:04:18 -08:00
parent 5d5fd9e241
commit fb3c18349e
3 changed files with 4 additions and 64 deletions

View file

@ -192,20 +192,6 @@ abstract class ManiphestConduitAPIMethod extends ConduitAPIMethod {
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 @@ abstract class ManiphestConduitAPIMethod extends ConduitAPIMethod {
$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())

View file

@ -5,6 +5,10 @@ Using Phabricator event listeners to customize behavior.
= 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 @@ fields to, e.g., edit revision titles. Data available on this event:
- `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

View file

@ -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';