diff --git a/application/Espo/Classes/Cleanup/Audit.php b/application/Espo/Classes/Cleanup/Audit.php index 8b6161d839..47d39a4a2e 100644 --- a/application/Espo/Classes/Cleanup/Audit.php +++ b/application/Espo/Classes/Cleanup/Audit.php @@ -87,8 +87,9 @@ class Audit implements Cleanup $scopeList = array_keys($this->metadata->get(['scopes']) ?? []); $scopeList = array_filter($scopeList, function ($item) { - return $this->metadata->get(['scopes', $item, 'entity']) && - !$this->metadata->get(['scopes', $item, 'stream']); + return $this->metadata->get("scopes.$item.entity") && + !$this->metadata->get("scopes.$item.preserveAuditLog") && + !$this->metadata->get("scopes.$item.stream"); }); return array_values($scopeList); diff --git a/schema/metadata/scopes.json b/schema/metadata/scopes.json index 3321ff6717..c2e7125c67 100644 --- a/schema/metadata/scopes.json +++ b/schema/metadata/scopes.json @@ -286,6 +286,10 @@ "description": "Whether the entity may contain personal data.", "type": "boolean" }, + "preserveAuditLog": { + "description": "Disables audit log cleanup. As of v8.5.", + "type": "boolean" + }, "exportFormatList": { "description": "A list of allowed export formats. E.g. csv, xlsx.", "type": "array",