1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-26 16:52:41 +01:00

Don't consider integer CustomFields as changed when the number doesn't change

Summary: Fixes T4466. We do an excessively strict effect check now, which means that these fields changing from (string) "16" to (int) 16 generates a transaction. Instead, compare integer values if the field has data in it.

Test Plan:
{F116261}

(Also made updates without changing the number, which did not appear in the transaction log anymore.)

Reviewers: btrahan, richardvanvelzen

Reviewed By: richardvanvelzen

CC: aran

Maniphest Tasks: T4466

Differential Revision: https://secure.phabricator.com/D8292
This commit is contained in:
epriestley 2014-02-21 08:59:31 -08:00
parent 67326bb47a
commit 9384c9e36b

View file

@ -95,4 +95,19 @@ final class PhabricatorStandardCustomFieldInt
return $errors;
}
public function getApplicationTransactionHasEffect(
PhabricatorApplicationTransaction $xaction) {
$old = $xaction->getOldValue();
$new = $xaction->getNewValue();
if (!strlen($old) && strlen($new)) {
return true;
} else if (strlen($old) && !strlen($new)) {
return true;
} else {
return ((int)$old !== (int)$new);
}
}
}