From e859068670ca30f191f6fd758eb1880487fb8b1c Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Thu, 10 Oct 2024 10:45:39 +0300 Subject: [PATCH] preserve audit log param --- application/Espo/Classes/Cleanup/Audit.php | 5 +++-- schema/metadata/scopes.json | 4 ++++ 2 files changed, 7 insertions(+), 2 deletions(-) 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",