Merge pull request #11263 from inietov/fixes/dont_save_update_action_if_nothings_changed
Fixes log update action even if no changes are made to assets [sc-19131]
This commit is contained in:
commit
7faaa4ce24
1 changed files with 6 additions and 2 deletions
|
@ -26,7 +26,7 @@ class AssetObserver
|
||||||
&& ($attributes['checkout_counter'] == $attributesOriginal['checkout_counter'])
|
&& ($attributes['checkout_counter'] == $attributesOriginal['checkout_counter'])
|
||||||
&& ($attributes['checkin_counter'] == $attributesOriginal['checkin_counter'])
|
&& ($attributes['checkin_counter'] == $attributesOriginal['checkin_counter'])
|
||||||
&& ((isset( $attributes['next_audit_date']) ? $attributes['next_audit_date'] : null) == (isset($attributesOriginal['next_audit_date']) ? $attributesOriginal['next_audit_date']: null))
|
&& ((isset( $attributes['next_audit_date']) ? $attributes['next_audit_date'] : null) == (isset($attributesOriginal['next_audit_date']) ? $attributesOriginal['next_audit_date']: null))
|
||||||
&& ($attributes['last_checkout'] == $attributesOriginal['last_checkout']))
|
&& ($attributes['last_checkout'] == $attributesOriginal['last_checkout']))
|
||||||
{
|
{
|
||||||
$changed = [];
|
$changed = [];
|
||||||
|
|
||||||
|
@ -35,7 +35,11 @@ class AssetObserver
|
||||||
$changed[$key]['old'] = $asset->getRawOriginal()[$key];
|
$changed[$key]['old'] = $asset->getRawOriginal()[$key];
|
||||||
$changed[$key]['new'] = $asset->getAttributes()[$key];
|
$changed[$key]['new'] = $asset->getAttributes()[$key];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (empty($changed)){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$logAction = new Actionlog();
|
$logAction = new Actionlog();
|
||||||
$logAction->item_type = Asset::class;
|
$logAction->item_type = Asset::class;
|
||||||
|
|
Loading…
Add table
Reference in a new issue