Skip to content

Commit

Permalink
pkp/pkp-lib#10292 make context id required on controlled vocabs opera…
Browse files Browse the repository at this point in the history
…tions
  • Loading branch information
touhidurabir committed Nov 29, 2024
1 parent ecab2a0 commit 9f36bb8
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 2 deletions.
34 changes: 34 additions & 0 deletions classes/migration/install/ControlledVocabMigration.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php

/**
* @file classes/migration/install/ControlledVocabMigration.php
*
* Copyright (c) 2024 Simon Fraser University
* Copyright (c) 2024 John Willinsky
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING.
*
* @class ControlledVocabMigration
*
* @brief Describe database table structures.
*/

namespace APP\migration\install;

class ControlledVocabMigration extends \PKP\migration\install\ControlledVocabMigration
{
/**
* @copydoc \PKP\migration\install\ControlledVocabMigration::getContextTable()
*/
protected function getContextTable(): string
{
return 'journals';
}

/**
* @copydoc \PKP\migration\install\ControlledVocabMigration::getContextPrimaryKey()
*/
protected function getContextPrimaryKey(): string
{
return 'journal_id';
}
}
2 changes: 1 addition & 1 deletion dbscripts/xml/install.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<migration class="PKP\migration\install\CommonMigration" />
<migration class="PKP\migration\install\SessionsMigration" />
<migration class="PKP\migration\install\GenresMigration" />
<migration class="PKP\migration\install\ControlledVocabMigration" />
<migration class="APP\migration\install\ControlledVocabMigration" />
<migration class="PKP\migration\install\FailedJobsMigration" />
<migration class="PKP\migration\install\FilesMigration" />
<migration class="PKP\migration\install\JobsMigration" />
Expand Down
5 changes: 4 additions & 1 deletion tools/cleanReviewerInterests.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,10 @@ public function execute(): void
protected function _getOrphanVocabInterests(): Collection
{
$controlledVocab = Repo::controlledVocab()->build(
UserInterest::CONTROLLED_VOCAB_INTEREST
UserInterest::CONTROLLED_VOCAB_INTEREST,
UserInterest::CONTROLLED_VOCAB_INTEREST_ASSOC_TYPE,
UserInterest::CONTROLLED_VOCAB_INTEREST_ASSOC_ID,
UserInterest::CONTROLLED_VOCAB_INTEREST_CONTEXT_ID
);

return ControlledVocabEntry::query()
Expand Down

0 comments on commit 9f36bb8

Please sign in to comment.