1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-23 22:10:55 +01:00

Fix a bug where some Maniphest batch edits were incorrectly skipped

Summary: Currently, if you have a task with project "X" and you apply a batch edit to it to remove "X", the action has no effect because we incorrectly skip the edit as a no-op. Instead, don't perform this check for edge edits.

Test Plan: Batch removed a project from several tasks with only one project.

Reviewers: vrana, btrahan

Reviewed By: vrana

CC: aran

Maniphest Tasks: T1566

Differential Revision: https://secure.phabricator.com/D3092
This commit is contained in:
epriestley 2012-07-27 15:25:32 -07:00
parent aa47677dfd
commit f1eb92a126

View file

@ -160,6 +160,11 @@ final class ManiphestBatchEditController extends ManiphestController {
'remove_project' => ManiphestTransactionType::TYPE_PROJECTS,
);
$edge_edit_types = array(
'add_project' => true,
'remove_project' => true,
);
$xactions = array();
foreach ($actions as $action) {
if (empty($type_map[$action['action']])) {
@ -223,10 +228,15 @@ final class ManiphestBatchEditController extends ManiphestController {
break;
}
// If the edit doesn't change anything, go to the next action.
// If the edit doesn't change anything, go to the next action. This
// check is only valid for changes like "owner", "status", etc, not
// for edge edits, because we should still apply an edit like
// "Remove Projects: A, B" to a task with projects "A, B".
if ($value == $current) {
continue;
if (empty($edge_edit_types[$action['action']])) {
if ($value == $current) {
continue;
}
}
// Apply the value change; for most edits this is just replacement, but