# HG changeset patch # User Kim Alvefur # Date 1628811435 -7200 # Node ID b91e40472d68d213dc1ed5d15913d273b37018d2 # Parent 072d078be095e91a7521129d611bcd20d1270dde mod_storage_xmlarchive: Fix return of numeric 'when' from key-value API At some point, 'when' was stored as a timestamp string then as a numeric UNIX timestamp, so both cases needs to be handled, as they are elsewhere. Thanks spec/core_storagemanager_spec.lua diff -r 072d078be095 -r b91e40472d68 mod_storage_xmlarchive/mod_storage_xmlarchive.lua --- a/mod_storage_xmlarchive/mod_storage_xmlarchive.lua Fri Aug 13 01:18:32 2021 +0200 +++ b/mod_storage_xmlarchive/mod_storage_xmlarchive.lua Fri Aug 13 01:37:15 2021 +0200 @@ -1,5 +1,5 @@ -- mod_storage_xmlarchive --- Copyright (C) 2015-2020 Kim Alvefur +-- Copyright (C) 2015-2021 Kim Alvefur -- -- This file is MIT/X11 licensed. -- @@ -84,7 +84,7 @@ local data = xmlfile:read(item.length); local parsed, perr = xml.parse(data); if not parsed then return nil, perr; end - return parsed, dt.parse(item.when), item.with; + return parsed, tonumber(item.when) or dt.parse(item.when), item.with; end local overwrite = module:get_option("xmlarchive_overwrite", false);