Skip to content

Commit

Permalink
Merge pull request #10728 from bozana/10726
Browse files Browse the repository at this point in the history
#10726 consider all existing submission metadata langauges
  • Loading branch information
bozana authored Jan 9, 2025
2 parents 7b40613 + eec13bb commit 4e70f57
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
3 changes: 2 additions & 1 deletion classes/section/Repository.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* @file classes/section/Repository.php
*
Expand Down Expand Up @@ -88,7 +89,7 @@ public function getSchemaMap(): maps\Schema
public function validate(?Section $object, array $props, Context $context): array
{
$errors = [];
$allowedLocales = $context->getSupportedSubmissionLocales();
$allowedLocales = $context->getSupportedFormLocales();
$primaryLocale = $context->getPrimaryLocale();

$validator = ValidatorFactory::make(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
use APP\plugins\importexport\native\NativeImportExportDeployment;
use APP\publication\Publication;
use Exception;
use PKP\controlledVocab\ControlledVocab;
use PKP\citation\CitationDAO;
use PKP\controlledVocab\ControlledVocab;
use PKP\db\DAORegistry;
use PKP\filter\FilterGroup;
use PKP\plugins\importexport\PKPImportExportFilter;
Expand Down Expand Up @@ -215,16 +215,14 @@ public function addMetadata($doc, $entityNode, $entity)

// add controlled vocabularies
// get the supported locale keys
$supportedLocales = $deployment->getContext()->getSupportedFormLocales();
$controlledVocabulariesMapping = $this->_getControlledVocabulariesMappings();
foreach ($controlledVocabulariesMapping as $controlledVocabulariesNodeName => $mappings) {
$symbolic = $mappings[0];
$controlledVocabularyNodeName = $mappings[1];
$controlledVocabulary = Repo::controlledVocab()->getBySymbolic(
$symbolic,
Application::ASSOC_TYPE_PUBLICATION,
$entity->getId(),
$supportedLocales
$entity->getId()
);
$this->addControlledVocabulary($doc, $entityNode, $controlledVocabulariesNodeName, $controlledVocabularyNodeName, $controlledVocabulary);
}
Expand Down

0 comments on commit 4e70f57

Please sign in to comment.