Quick's GetMemento() Method Doest Not Return Current Entity State Data

Description

When I create a new instance of an entity, populate it with data using `populateModel()` (or using setter methods), running `getMemento()` on the entity doesn't return the current state of the object:

Example:
component{

}
Result:
https://i.imgur.com/CQoIcP9.png

Here's where things get interesting... If I run the method `isDirty()` on the entity before running `getMemento()` the output structure will contain the current state of the object:


// get a new instance of "user"
prc.user = getInstance( "User" );

// set some data
prc.user.setFirstName( "Dave" );
prc.user.setLastName( "Levin" );

// dump out some data using the Quick's getMemento() method
writeDump(
var = prc.user.getMemento(),
label = "first run of GetMemento()"
);

// run isDirty() - which seems to workaround the issue
writeDump( prc.user.isDirty() );

// dump the memento again - the data is populated!
writeDump(
var = prc.user.getMemento(),
label = "second run of GetMemento()"
);

Result:
https://i.imgur.com/hHxFoGZ.png

I was able to trace the issue back to a method in Quick that `isDirty()` calls named `retrieveAttributesData()`. However, I wasn't able to figure out why calling that method enables `getMemento()` to work. Side note, I can replicate the issue on both Lucee and ACF.

Environment

None

Status

Assignee

Unassigned

Reporter

David Levin

Labels

None

Priority

Major
Configure