From c1213e0abc364a981d4f89c87d4ba6bc9ae80f9c Mon Sep 17 00:00:00 2001 From: snipe Date: Thu, 26 Oct 2023 09:41:44 +0100 Subject: [PATCH] Nicer handling for empty custom fields Signed-off-by: snipe --- app/Http/Transformers/ActionlogsTransformer.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/Http/Transformers/ActionlogsTransformer.php b/app/Http/Transformers/ActionlogsTransformer.php index 61ae1af9a2..db7105fc9a 100644 --- a/app/Http/Transformers/ActionlogsTransformer.php +++ b/app/Http/Transformers/ActionlogsTransformer.php @@ -101,9 +101,10 @@ class ActionlogsTransformer $clean_meta[$fieldname]['old'] = "************"; $clean_meta[$fieldname]['new'] = "************"; + // Display the changes if the user is an admin or superadmin if (Gate::allows('admin')) { - $clean_meta[$fieldname]['old'] = unserialize($enc_old); - $clean_meta[$fieldname]['new'] = unserialize($enc_new); + $clean_meta[$fieldname]['old'] = ($enc_old) ? unserialize($enc_old): '(blank)'; + $clean_meta[$fieldname]['new'] = ($enc_new) ? unserialize($enc_new): '(blank)'; } }