Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to get and show old value of field #38

Closed
phuongdm1987 opened this issue Mar 29, 2016 · 7 comments
Closed

How to get and show old value of field #38

phuongdm1987 opened this issue Mar 29, 2016 · 7 comments

Comments

@phuongdm1987
Copy link

I can not get old value of field when show log by logCustomFields.

@anteriovieira
Copy link
Member

Hello @phuongdm1987 ,

please, show me an example of what you like to do.

@phuongdm1987
Copy link
Author

Hi @anteriovieira,

I want to declare $logCustomFields as below with aol value like {old.name}

public static $logCustomFields = [ 'name' => 'The name change to {old.value} from {new.name}' ];

@anteriovieira
Copy link
Member

Is correct? ... {old.value} ... or would ... {old.name} ... in your example

@phuongdm1987
Copy link
Author

Hi @anteriovieira,

when call {new.name} only then ok
when call {new.name} with {old.name} or {old.value} then fail, not show log.

@anteriovieira
Copy link
Member

When it fails, it shows an error message? His log records contain old values?

@anteriovieira
Copy link
Member

@phuongdm1987 , thank you for reporting.

The failure is precisely because you do not have old value, to resolve use a default value for the field.

public static $logCustomFields = [ 
    'name' => 'The name change to {old.value|Default value} from {new.name|Default value}' 
];

But you were right to report, this should not happen. I will adjust this as soon as possible

@anteriovieira
Copy link
Member

Hi, @phuongdm1987 , Was adjusted, anything we are here.

New version available: v2.2.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants