mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-22 05:20:56 +01:00
Detect edits which don't actually change projects in Maniphest tasks
Summary: Be smarter about detecting when projects haven't actually changed so we don't create silly transactions which just reorder them or change (entirely arbitrary) dictionary keys. Test Plan: Edited a task with several projects and swapped their order, didn't get a bogus project transaction. Reviewed By: tuomaspelkonen Reviewers: tuomaspelkonen, jungejason, aran CC: anjali, sandra, aran, tuomaspelkonen, epriestley Differential Revision: 249
This commit is contained in:
parent
870f4bfe73
commit
1ed915aef2
1 changed files with 10 additions and 3 deletions
|
@ -112,9 +112,16 @@ class ManiphestTaskEditController extends ManiphestController {
|
|||
$changes[ManiphestTransactionType::TYPE_CCS] = $request->getArr('cc');
|
||||
}
|
||||
|
||||
if ($request->getArr('projects') != $task->getProjectPHIDs()) {
|
||||
$changes[ManiphestTransactionType::TYPE_PROJECTS]
|
||||
= $request->getArr('projects');
|
||||
$new_proj_arr = $request->getArr('projects');
|
||||
$new_proj_arr = array_values($new_proj_arr);
|
||||
sort($new_proj_arr);
|
||||
|
||||
$cur_proj_arr = $task->getProjectPHIDs();
|
||||
$cur_proj_arr = array_values($cur_proj_arr);
|
||||
sort($cur_proj_arr);
|
||||
|
||||
if ($new_proj_arr != $cur_proj_arr) {
|
||||
$changes[ManiphestTransactionType::TYPE_PROJECTS] = $new_proj_arr;
|
||||
}
|
||||
|
||||
if ($files) {
|
||||
|
|
Loading…
Reference in a new issue