Skip to content

A free open source IT asset/license management system

Actually, re-introduce this code comment as it's still relevant and tricky

Brady Wetherington31dde20a2bc4
diff --git a/app/Http/Transformers/ActionlogsTransformer.php b/app/Http/Transformers/ActionlogsTransformer.php
index 3006fb4b0b..2cda176bf6 100644
--- a/app/Http/Transformers/ActionlogsTransformer.php
+++ b/app/Http/Transformers/ActionlogsTransformer.php
@@ -21,6 +21,14 @@ class ActionlogsTransformer
private function clean_field($value)
{
+ // This object stuff is weird, and is used to make up for the fact that
+ // older data can get strangely formatted if an asset existed,
+ // then a new custom field is added, and the asset is saved again.
+ // It can result in funnily-formatted strings like:
+ //
+ // {"_snipeit_right_sized_fault_tolerant_localareanetwo_1":
+ // {"old":null,"new":{"value":"1579490695972","_snipeit_new_field_2":2,"_snipeit_new_field_3":"Monday, 20 January 2020 2:24:55 PM"}}
+ // so we have to walk down that next level
if(is_object($value) && isset($value->value)) {
return clean_field($value->value);
}