quick icon indicating copy to clipboard operation
quick copied to clipboard

[Quick 7] Regression: No Longer Preserving Casted Value After Saving Entity

Open homestar9 opened this issue 1 year ago • 1 comments

In 4.1.1, 4.1.2, Quick was updated to preserve casted values after saving. However, in v5 (as of 5.2.1), Quick no longer preserves the value.

How to replicate

// create entity that uses any cast (e.g. BooleanCast@quick)
property name="foo" casts="BooleanCast@quick";

// in your handler, set the value to "0" (a string representation of 0)
getInstance( "myEntity" ).setFoo( "0" );

// dump out the memento
writeDump( serializeJson( myEntity.getMemento() ) ); // foo will be "0"

// persist the entity
myEntity.save();

// dump out the memento
writeDump( serializeJson( myEntity.getMemento() ) ); // foo will still be "0" in Quick 5, but will be false in Quick 4

Quick 4 handles the cast properly when persisting, but Quick 5 doesn't seem to recast anymore.

Quick 4: image

Quick 5: image

homestar9 avatar Oct 14 '22 21:10 homestar9