meveo-org / meveo

meveo core
GNU Affero General Public License v3.0
10 stars 15 forks source link

cannot create CET with CFT that are reference to User when CET has CrudScript #736

Closed smichea closed 1 year ago

smichea commented 1 year ago

looks like the pb comes from that image

        try {
            Method getUuid = object.getClass().getMethod("getUuid");
            return getUuid.invoke(object);
        } catch(Exception ignored) {
        }
tonysviews commented 1 year ago

additional context:

This user entity is being associated to an NFCTag entity: image

image

When it is passed into a CrudListenerScript:

image

The data in the owner entity is lost:

image

tonysviews commented 1 year ago

When debugging the issue, it seems that during deserialization, the User type CFT will try to deserialize using JacksonUtil. This results in a new User object.

I believe a possible fix for this is to move the following lines in CEIUtils:

image