mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-26 00:32:42 +01:00
Make omitting "value" from a transaction description an explicit error
Summary: See PHI1710. Until D21044, some transactions could omit "value" and apply correctly. This now throws an exception when accessing `$xaction['value']`. All transactions are expected to have a "value" key, so require it explicitly rather than implicitly. Test Plan: Submitted a transaction with a "type" but no "value". After D21044, got a language-level exception. After this change, got an explicit exception. Differential Revision: https://secure.phabricator.com/D21176
This commit is contained in:
parent
604811bfc5
commit
b5bed7b0fa
1 changed files with 10 additions and 0 deletions
|
@ -2204,6 +2204,16 @@ abstract class PhabricatorEditEngine
|
|||
$transactions_key,
|
||||
$key));
|
||||
}
|
||||
|
||||
if (!array_key_exists('value', $xaction)) {
|
||||
throw new Exception(
|
||||
pht(
|
||||
'Parameter "%s" must contain a list of transaction descriptions, '.
|
||||
'but item with key "%s" is missing a "value" field. Each '.
|
||||
'transaction must have a value field.',
|
||||
$transactions_key,
|
||||
$key));
|
||||
}
|
||||
}
|
||||
|
||||
return $xactions;
|
||||
|
|
Loading…
Reference in a new issue