You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When validating multidimensional array data (e.g., name.ja.0.family_name), validation errors occur as expected, but the corresponding error messages are not displayed in the form input fields.
Steps to Reproduce
Define validation for fields with the following data structure:
if (!$errors && $entityErrors && !is_array($entity)) {
This condition skips error processing when $entity is an array, resulting in the error message not being propagated to the form field.
Suggested Fix
Modify the condition as follows to ensure errors are processed correctly for arrays:
if (!$errors && $entityErrors) {
Expected Behavior After Fix
Even when $entity is a multidimensional array, errors should be processed correctly, and the error messages should appear in the corresponding form input fields.
Question
Is this fix appropriate, or is the issue caused by a problem in the validation method itself?
The text was updated successfully, but these errors were encountered:
Summary
When validating multidimensional array data (e.g.,
name.ja.0.family_name
), validation errors occur as expected, but the corresponding error messages are not displayed in the form input fields.Steps to Reproduce
family_name
left empty.Observed Behavior
Validation errors are triggered, and the following error is generated:
However, the error message does not appear in the corresponding
input
field in the form.Cause
The issue lies in the following section of the
DocumentContext
class:https://github.com/cakephp/elastic-search/blob/4.x/src/View/Form/DocumentContext.php#L424
Current code:
This condition skips error processing when
$entity
is an array, resulting in the error message not being propagated to the form field.Suggested Fix
Modify the condition as follows to ensure errors are processed correctly for arrays:
Expected Behavior After Fix
Even when
$entity
is a multidimensional array, errors should be processed correctly, and the error messages should appear in the corresponding form input fields.Question
Is this fix appropriate, or is the issue caused by a problem in the validation method itself?
The text was updated successfully, but these errors were encountered: