From 2f9ddea569855f1a137df657ab6a9bfc9a573256 Mon Sep 17 00:00:00 2001 From: Vitalii Bezsheiko Date: Sun, 28 May 2023 22:41:25 +0300 Subject: [PATCH] pkp/pkp-lib#8933 Pass Context to event log Repository::validate() --- classes/log/event/Repository.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/classes/log/event/Repository.php b/classes/log/event/Repository.php index 2f1d092959a..65bfd091406 100644 --- a/classes/log/event/Repository.php +++ b/classes/log/event/Repository.php @@ -14,6 +14,7 @@ namespace PKP\log\event; use APP\facades\Repo; +use PKP\context\Context; use PKP\core\PKPApplication; use PKP\core\PKPRequest; use PKP\plugins\Hook; @@ -80,8 +81,11 @@ public function getSchemaMap(): maps\Schema * * @return array A key/value array with validation errors. Empty if no errors */ - public function validate(?EventLogEntry $object, array $props, array $allowedLocales, string $primaryLocale): array + public function validate(?EventLogEntry $object, array $props, Context $context): array { + $allowedLocales = $context->getSupportedSubmissionLocales();; + $primaryLocale = $context->getPrimaryLocale(); + $validator = ValidatorFactory::make( $props, $this->schemaService->getValidationRules($this->dao->schema, $allowedLocales)