Skip to content

Crash when using "Revert" from advanced logs #99

@MegaphoneJon

Description

@MegaphoneJon

I know this complicates an already complicated set of NULLIF and IFNULL, but when you try to use the Revert this Change button on the advanced Change Log tab, you get a crash.

You have some code that generates this as part of a trigger:

 IFNULL(OLD.`amount_of_last_contribution_77`,'')

This places an empty string instead of a NULL, for understandable reasons.

However, these custom fields are of type "Money", and "Money" is validated with CRM_Utils_Rule::numeric(). That says only numeric values pass validation.

This normally doesn't come up because the triggers bypass validation, and the fields are read-only, so the value is never changed in a validated way - except if you try to revert the change.

I'm not sure it's worth the time it'll take to fix, but I wanted to make sure it's documented for others who experience this.

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