Closed mikerogerz closed 2 years ago
Affects CakePHP 3.7.*
When applying additional validation rules to behavior-applied fields, data array is empty in callback context ($context['data'], for example).
For example: $validation->allowEmptyFile('filename', function ($context) { })
$validation->allowEmptyFile('filename', function ($context) { })
$context['data'] will be empty. This also breaks the ability to use either 'create' or 'update' instead of a function.
The culprit seems to be at the following line: https://github.com/FriendsOfCake/cakephp-upload/blob/7d21c546bbf718e95b011c1c9a42a689d076ea6f/src/Model/Behavior/UploadBehavior.php#L64
Affects CakePHP 3.7.*
When applying additional validation rules to behavior-applied fields, data array is empty in callback context ($context['data'], for example).
For example:
$validation->allowEmptyFile('filename', function ($context) { })
$context['data'] will be empty. This also breaks the ability to use either 'create' or 'update' instead of a function.
The culprit seems to be at the following line: https://github.com/FriendsOfCake/cakephp-upload/blob/7d21c546bbf718e95b011c1c9a42a689d076ea6f/src/Model/Behavior/UploadBehavior.php#L64