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

This commit is contained in:
Brady Wetherington 2022-03-03 15:48:04 -08:00
parent aa36ebc947
commit 31dde20a2b

View file

@ -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);
}