Skip to content

model validate method cannot evaluate this.propertyIsPresent in a condition argument #3238

Description

@chapmandu

Describe the bug

The `condition` expression `this.propertyIsPresent('productid')` could not be evaluated: The parameter [property] to function [propertyIsPresent] is required but was not passed in.
validations.cfc:587

Supported forms: `this.property`, `this.method()`, bare `method()` (optionally negated with `!`), and binary comparisons using eq/neq/lt/lte/gt/gte or ==/!=//>=.

    /app/vendor/wheels/model/validations.cfc:587
    /app/vendor/wheels/model/validations.cfc:484
    /app/vendor/wheels/model/create.cfc:155
    /app/vendor/wheels/Global.cfc:358
    /app/vendor/wheels/model/transactions.cfc:74
    /app/vendor/wheels/model/create.cfc:92

To Reproduce
Steps to reproduce the behavior:
Create a custom validation method on a model with a condition as below

validate(method = "_validateSomething", condition = "this.propertyIsPresent('productid')");

Expected behavior
Validation method should be executed only if productid property exists and has a value.

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