Skip to content

Save returns objects different from what they are into the database #457

Closed
@Kira2

Description

@Kira2

Hi,

I have a very strange behavior when I save an object, and that I apply a beforeSave trigger on it.

We suppose we have an object with an attribute equal to "100". We also have a "beforeSave" trigger that modifies this value to "50", if some conditions are right.

Now, when I call object.save(), the "beforeSave" is triggered, the value into the database is "50", but the value returned by the "save" operation is still "100".

How is it possible that the "save" operation returns an object with attributes different from what they are into the database?

Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:bugImpaired feature or lacking behavior that is likely assumed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions