Merge pull request #16787 from uberbrady/suppress_action_date_error_in_loggable
Fixed: [RB-19645] Suppress error message about 'action_date' not existing
This commit is contained in:
commit
ed86c90b7e
1 changed files with 3 additions and 1 deletions
|
@ -100,13 +100,15 @@ trait Loggable
|
|||
|
||||
|
||||
foreach ($originalValues as $key => $value) {
|
||||
// TODO - action_date isn't a valid attribute of any first-class object, so we might want to remove this?
|
||||
if ($key == 'action_date' && $value != $action_date) {
|
||||
$changed[$key]['old'] = $value;
|
||||
$changed[$key]['new'] = is_string($action_date) ? $action_date : $action_date->format('Y-m-d H:i:s');
|
||||
} elseif ($value != $this->getAttributes()[$key]) {
|
||||
} elseif (array_key_exists($key, $this->getAttributes()) && $value != $this->getAttributes()[$key]) {
|
||||
$changed[$key]['old'] = $value;
|
||||
$changed[$key]['new'] = $this->getAttributes()[$key];
|
||||
}
|
||||
// NOTE - if the attribute exists in $originalValues, but *not* in ->getAttributes(), it isn't added to $changed
|
||||
}
|
||||
|
||||
if (!empty($changed)){
|
||||
|
|
Loading…
Add table
Reference in a new issue