Skip to content

A free open source IT asset/license management system

Fixed #19052 - PUT next_audit_date does not produce audit log entry

snipece0ce8688bba
diff --git a/app/Observers/AssetObserver.php b/app/Observers/AssetObserver.php
index 8672c43cb2..30088adecd 100644
--- a/app/Observers/AssetObserver.php
+++ b/app/Observers/AssetObserver.php
@@ -35,12 +35,12 @@ class AssetObserver
$same_checkin_counter = (($attributes['checkin_counter'] == $attributesOriginal['checkin_counter']));
}
- // If the asset isn't being checked out or audited, log the update.
- // (Those other actions already create log entries.)
+ // If the asset isn't being checked out, log the update.
+ // (Checkout/checkin/audit actions already create their own log entries; the audit
+ // path uses unsetEventDispatcher() so it never reaches this observer.)
if (array_key_exists('assigned_to', $attributes) && array_key_exists('assigned_to', $attributesOriginal)
&& ($attributes['assigned_to'] == $attributesOriginal['assigned_to'])
&& ($same_checkout_counter) && ($same_checkin_counter)
- && ((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']) && (! $restoring_or_deleting)) {
$changed = [];