Page 1 of 1

AuditableListener

Posted: Tue Sep 11, 2012 12:53 am
by ganu98
While i was looking the code for audit-trial field i found org.broadleafcommerce.common.audit.AuditableListener which populate created user id always 0
protected void setAuditValueAgent(Field field, Object entity) throws IllegalArgumentException, IllegalAccessException {
try {
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
if (authentication != null) {
Object principal = authentication.getPrincipal();
}
} catch (Exception e) {
e.printStackTrace();
}
field.setAccessible(true);
field.set(entity, 0L);
}

if this is the case then how do it populate audit field. If this code is expected then how it will populate creator field

Re: AuditableListener

Posted: Fri Sep 14, 2012 11:32 am
by jefffischer
Thanks for pointing this bug out to us. What version of Broadleaf are you using?

Re: AuditableListener

Posted: Sun Sep 16, 2012 9:16 am
by ganu98
Thanks Jeff. I found it has been fixed in version 2.0