8000 Validation in patchEntity happens for fields excluded for proessing with 'fields' option. · Issue #18232 · cakephp/cakephp · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Validation in patchEntity happens for fields excluded for proessing with 'fields' option. #18232
Open
@menshutin

Description

@menshutin

Description

According to documentation we can skip some properties from being assigned with the help of 'fields' option.

But Marshaller:merge() is calling validate for all data posted, including attributes that are supposed to be excluded.
If this excluded attributes hold the wrong data (for some reason), than validation will result in error and data will not be saved into database.

Instead, we should validate only required (not excluded) fields, or, alternatively, suppress validation errors for excluded fields.

CakePHP Version

5.0

PHP Version

8.1

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0