Skip to content

Commit

Permalink
pkp#8933 Pass Context to event log Repository::validate()
Browse files Browse the repository at this point in the history
  • Loading branch information
Vitaliy-1 committed Jun 2, 2023
1 parent cc86ccb commit 2f9ddea
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion classes/log/event/Repository.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 2f9ddea

Please sign in to comment.