Skip to content

Context property label not correct after Nested() rule #821

Description

@jettero777

Description

Nested() rule changes property displayed by following rules (sibling rules)

example rules:

'property1' => [
    new Nested([
        'property2' => ... // any rule
    ]),
    new Required(
        emptyCondition: fn() => true, // trigger for testing
    ),
]

error in the Required() rule will be "Property2 cannot be blank.", but it should be "Property1 cannot be blank.",
it could be any rule after Nested(),

if Callback() rule is used, $context inside callback will be:

$context->getProperty(); // 'property1' => right
$context->getPropertyLabel(); // 'property2' => wrong
$context->getTranslatedProperty(); // 'property2' => wrong

so, seems it is just label corrupted somewhere, not property name itself

Package version

No response

PHP version

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions