From 28ce2588cadd7e53e6f53a95f90ce80cf00380f0 Mon Sep 17 00:00:00 2001 From: Touhidur Rahman Date: Fri, 16 Aug 2024 17:56:04 +0600 Subject: [PATCH 01/20] pkp/pkp-lib#10292 Controlled Vocab DAO to Eloquent Model --- plugins/reports/articles/ArticleReportPlugin.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/plugins/reports/articles/ArticleReportPlugin.php b/plugins/reports/articles/ArticleReportPlugin.php index 4e454bec270..23117afb747 100644 --- a/plugins/reports/articles/ArticleReportPlugin.php +++ b/plugins/reports/articles/ArticleReportPlugin.php @@ -24,7 +24,7 @@ use PKP\security\Role; use PKP\stageAssignment\StageAssignment; use PKP\submission\PKPSubmission; -use PKP\submission\SubmissionAgencyDAO; +use PKP\submission\SubmissionAgencyVocab; use PKP\submission\SubmissionDisciplineDAO; use PKP\submission\SubmissionKeywordDAO; use PKP\submission\SubmissionSubjectDAO; @@ -89,7 +89,6 @@ public function display($args, $request) $submissionKeywordDao = DAORegistry::getDAO('SubmissionKeywordDAO'); /** @var SubmissionKeywordDAO $submissionKeywordDao */ $submissionSubjectDao = DAORegistry::getDAO('SubmissionSubjectDAO'); /** @var SubmissionSubjectDAO $submissionSubjectDao */ $submissionDisciplineDao = DAORegistry::getDAO('SubmissionDisciplineDAO'); /** @var SubmissionDisciplineDAO $submissionDisciplineDao */ - $submissionAgencyDao = DAORegistry::getDAO('SubmissionAgencyDAO'); /** @var SubmissionAgencyDAO $submissionAgencyDao */ $userGroups = UserGroup::withContextIds([$context->getId()]) ->get() @@ -162,7 +161,7 @@ public function display($args, $request) $subjects = $submissionSubjectDao->getSubjects($submission->getCurrentPublication()->getId()); $disciplines = $submissionDisciplineDao->getDisciplines($submission->getCurrentPublication()->getId()); $keywords = $submissionKeywordDao->getKeywords($submission->getCurrentPublication()->getId()); - $agencies = $submissionAgencyDao->getAgencies($submission->getCurrentPublication()->getId()); + $agencies = SubmissionAgencyVocab::getAgencies($submission->getCurrentPublication()->getId()); // Store the submission results $results[] = [ From 290ad1c9effef5414212504fcc21be38bb914b91 Mon Sep 17 00:00:00 2001 From: Touhidur Rahman Date: Fri, 16 Aug 2024 17:56:24 +0600 Subject: [PATCH 02/20] pkp/pkp-lib#10292 Submodule Update ##touhidurabir/i10292_main## --- lib/pkp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pkp b/lib/pkp index e0b14cf1c6f..94148594b3e 160000 --- a/lib/pkp +++ b/lib/pkp @@ -1 +1 @@ -Subproject commit e0b14cf1c6fc2afc8effbcd52b9b008aa8df0a6e +Subproject commit 94148594b3e7f830780d482eb1f4f39e910118a8 From ea522aa70c1562434a764aa207fafaacc960149b Mon Sep 17 00:00:00 2001 From: Touhidur Rahman Date: Mon, 19 Aug 2024 17:13:40 +0600 Subject: [PATCH 03/20] pkp/pkp-lib#10292 WIP: Controlled Vocab DAO to Eloquent Model --- ...0292_AddPrimaryKeyToUserInterestsTable.php | 43 +++++++++++++++++++ classes/search/ArticleSearch.php | 5 +-- .../doaj/filter/DOAJJsonFilter.php | 7 +-- .../doaj/filter/DOAJXmlFilter.php | 10 ++--- .../dc11/filter/Dc11SchemaArticleAdapter.php | 10 ++--- .../dc/tests/OAIMetadataFormat_DCTest.php | 23 +--------- .../rfc1807/OAIMetadataFormat_RFC1807.php | 4 +- .../reports/articles/ArticleReportPlugin.php | 7 ++- tools/cleanReviewerInterests.php | 40 +++++++---------- 9 files changed, 77 insertions(+), 72 deletions(-) create mode 100644 classes/migration/upgrade/v3_5_0/I10292_AddPrimaryKeyToUserInterestsTable.php diff --git a/classes/migration/upgrade/v3_5_0/I10292_AddPrimaryKeyToUserInterestsTable.php b/classes/migration/upgrade/v3_5_0/I10292_AddPrimaryKeyToUserInterestsTable.php new file mode 100644 index 00000000000..3d140eb2f4d --- /dev/null +++ b/classes/migration/upgrade/v3_5_0/I10292_AddPrimaryKeyToUserInterestsTable.php @@ -0,0 +1,43 @@ +bigIncrements('user_interest_id')->first(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('user_interests', function (Blueprint $table) { + $table->dropColumn('user_interest_id'); + }); + } +} diff --git a/classes/search/ArticleSearch.php b/classes/search/ArticleSearch.php index b9a48994156..4660b6d3870 100644 --- a/classes/search/ArticleSearch.php +++ b/classes/search/ArticleSearch.php @@ -200,7 +200,7 @@ public function getSearchFilters($request) $context = $contextDao->getById($searchFilters['searchJournal']); } elseif (array_key_exists('journalTitle', $request->getUserVars())) { $contexts = $contextDao->getAll(true); - while ($context = $contexts->next()) { + while ($context = $contexts->next()) { /** @var \PKP\context\Context $context */ if (in_array( $request->getUserVar('journalTitle'), (array) $context->getName(null) @@ -334,8 +334,7 @@ public function getSimilarityTerms($submissionId) $article = Repo::submission()->get($submissionId); if ($article->getData('status') === PKPSubmission::STATUS_PUBLISHED) { // Retrieve keywords (if any). - $submissionSubjectDao = DAORegistry::getDAO('SubmissionKeywordDAO'); /** @var \PKP\submission\SubmissionKeywordDAO $submissionSubjectDao */ - $allSearchTerms = array_filter($submissionSubjectDao->getKeywords($article->getCurrentPublication()->getId(), [Locale::getLocale(), $article->getData('locale'), Locale::getPrimaryLocale()])); + $allSearchTerms = array_filter(SubmissionKeywordVocab::getKeywords($article->getCurrentPublication()->getId(), [Locale::getLocale(), $article->getData('locale'), Locale::getPrimaryLocale()])); foreach ($allSearchTerms as $locale => $localeSearchTerms) { $searchTerms += $localeSearchTerms; } diff --git a/plugins/importexport/doaj/filter/DOAJJsonFilter.php b/plugins/importexport/doaj/filter/DOAJJsonFilter.php index e78518132af..c4fa514d6af 100644 --- a/plugins/importexport/doaj/filter/DOAJJsonFilter.php +++ b/plugins/importexport/doaj/filter/DOAJJsonFilter.php @@ -21,9 +21,8 @@ use APP\plugins\importexport\doaj\DOAJExportDeployment; use APP\plugins\importexport\doaj\DOAJExportPlugin; use PKP\core\PKPString; -use PKP\db\DAORegistry; use PKP\plugins\importexport\PKPImportExportFilter; -use PKP\submission\SubmissionKeywordDAO; +use PKP\submission\SubmissionKeywordVocab; class DOAJJsonFilter extends PKPImportExportFilter { @@ -176,9 +175,7 @@ public function &process(&$pubObject) $article['bibjson']['abstract'] = PKPString::html2text($abstract); } // Keywords - /** @var SubmissionKeywordDAO */ - $dao = DAORegistry::getDAO('SubmissionKeywordDAO'); - $keywords = $dao->getKeywords($publication->getId(), [$publicationLocale]); + $keywords = SubmissionKeywordVocab::getKeywords($publication->getId(), [$publicationLocale]); $allowedNoOfKeywords = array_slice($keywords[$publicationLocale] ?? [], 0, 6); if (!empty($keywords[$publicationLocale])) { $article['bibjson']['keywords'] = $allowedNoOfKeywords; diff --git a/plugins/importexport/doaj/filter/DOAJXmlFilter.php b/plugins/importexport/doaj/filter/DOAJXmlFilter.php index d5817b9f28f..522ad0c7ea7 100644 --- a/plugins/importexport/doaj/filter/DOAJXmlFilter.php +++ b/plugins/importexport/doaj/filter/DOAJXmlFilter.php @@ -21,9 +21,8 @@ use APP\publication\Publication; use APP\submission\Submission; use PKP\core\PKPString; -use PKP\db\DAORegistry; use PKP\i18n\LocaleConversion; -use PKP\submission\SubmissionKeywordDAO; +use PKP\submission\SubmissionKeywordVocab; class DOAJXmlFilter extends \PKP\plugins\importexport\native\filter\NativeExportFilter { @@ -189,16 +188,17 @@ public function &process(&$pubObjects) $request = Application::get()->getRequest(); $recordNode->appendChild($node = $doc->createElement('fullTextUrl', htmlspecialchars($request->getDispatcher()->url($request, Application::ROUTE_PAGE, null, 'article', 'view', [$pubObject->getId()], urlLocaleForPage: ''), ENT_COMPAT, 'UTF-8'))); $node->setAttribute('format', 'html'); + // Keywords $supportedLocales = $context->getSupportedFormLocales(); - /** @var SubmissionKeywordDAO */ - $dao = DAORegistry::getDAO('SubmissionKeywordDAO'); - $articleKeywords = $dao->getKeywords($publication->getId(), $supportedLocales); + $articleKeywords = SubmissionKeywordVocab::getKeywords($publication->getId(), $supportedLocales); + if (array_key_exists($publication->getData('locale'), $articleKeywords)) { $keywordsInArticleLocale = $articleKeywords[$publication->getData('locale')]; unset($articleKeywords[$publication->getData('locale')]); $articleKeywords = array_merge([$publication->getData('locale') => $keywordsInArticleLocale], $articleKeywords); } + foreach ($articleKeywords as $locale => $keywords) { $keywordsNode = $doc->createElement('keywords'); $keywordsNode->setAttribute('language', LocaleConversion::get3LetterIsoFromLocale($locale)); diff --git a/plugins/metadata/dc11/filter/Dc11SchemaArticleAdapter.php b/plugins/metadata/dc11/filter/Dc11SchemaArticleAdapter.php index dc8aa4d1758..ac5612e664f 100644 --- a/plugins/metadata/dc11/filter/Dc11SchemaArticleAdapter.php +++ b/plugins/metadata/dc11/filter/Dc11SchemaArticleAdapter.php @@ -35,8 +35,8 @@ use PKP\metadata\MetadataDescription; use PKP\plugins\Hook; use PKP\plugins\PluginRegistry; -use PKP\submission\SubmissionKeywordDAO; -use PKP\submission\SubmissionSubjectDAO; +use PKP\submission\SubmissionKeywordVocab; +use PKP\submission\SubmissionSubjectVocab; class Dc11SchemaArticleAdapter extends MetadataDataObjectAdapter { @@ -90,12 +90,10 @@ public function &extractMetadataFromDataObject(&$article) } // Subject - $submissionKeywordDao = DAORegistry::getDAO('SubmissionKeywordDAO'); /** @var SubmissionKeywordDAO $submissionKeywordDao */ - $submissionSubjectDao = DAORegistry::getDAO('SubmissionSubjectDAO'); /** @var SubmissionSubjectDAO $submissionSubjectDao */ $supportedLocales = $journal->getSupportedFormLocales(); $subjects = array_merge_recursive( - (array) $submissionKeywordDao->getKeywords($publication->getId(), $supportedLocales), - (array) $submissionSubjectDao->getSubjects($publication->getId(), $supportedLocales) + SubmissionKeywordVocab::getKeywords($publication->getId(), $supportedLocales), + SubmissionSubjectVocab::getSubjects($publication->getId(), $supportedLocales) ); $this->_addLocalizedElements($dc11Description, 'dc:subject', $subjects); diff --git a/plugins/oaiMetadataFormats/dc/tests/OAIMetadataFormat_DCTest.php b/plugins/oaiMetadataFormats/dc/tests/OAIMetadataFormat_DCTest.php index 71449fcd7cf..9c15bbf0709 100755 --- a/plugins/oaiMetadataFormats/dc/tests/OAIMetadataFormat_DCTest.php +++ b/plugins/oaiMetadataFormats/dc/tests/OAIMetadataFormat_DCTest.php @@ -45,8 +45,6 @@ use PKP\galley\Collector as GalleyCollector; use PKP\galley\Galley; use PKP\oai\OAIRecord; -use PKP\submission\SubmissionKeywordDAO; -use PKP\submission\SubmissionSubjectDAO; use PKP\tests\PKPTestCase; #[CoversClass(OAIMetadataFormat_DC::class)] @@ -58,7 +56,7 @@ class OAIMetadataFormat_DCTest extends PKPTestCase */ protected function getMockedDAOs(): array { - return [...parent::getMockedDAOs(), 'OAIDAO', 'SubmissionSubjectDAO', 'SubmissionKeywordDAO']; + return [...parent::getMockedDAOs(), 'OAIDAO']; } /** @@ -263,25 +261,6 @@ public function testToXml() ->willReturn(LazyCollection::wrap($galleys)); app()->instance(GalleyCollector::class, $mockGalleyCollector); - // Mocked DAO to return the subjects - $submissionSubjectDao = $this->getMockBuilder(SubmissionSubjectDAO::class) - ->onlyMethods(['getSubjects']) - ->getMock(); - $submissionSubjectDao->expects($this->any()) - ->method('getSubjects') - ->willReturn(['en' => ['article-subject', 'article-subject-class']]); - DAORegistry::registerDAO('SubmissionSubjectDAO', $submissionSubjectDao); - - // Mocked DAO to return the keywords - $submissionKeywordDao = $this->getMockBuilder(SubmissionKeywordDAO::class) - ->onlyMethods(['getKeywords']) - ->getMock(); - $submissionKeywordDao->expects($this->any()) - ->method('getKeywords') - ->willReturn(['en' => ['article-keyword']]); - DAORegistry::registerDAO('SubmissionKeywordDAO', $submissionKeywordDao); - - // // Test // diff --git a/plugins/oaiMetadataFormats/rfc1807/OAIMetadataFormat_RFC1807.php b/plugins/oaiMetadataFormats/rfc1807/OAIMetadataFormat_RFC1807.php index fd405c7de64..8f79b124651 100644 --- a/plugins/oaiMetadataFormats/rfc1807/OAIMetadataFormat_RFC1807.php +++ b/plugins/oaiMetadataFormats/rfc1807/OAIMetadataFormat_RFC1807.php @@ -26,8 +26,8 @@ use PKP\db\DAORegistry; use PKP\oai\OAIMetadataFormat; use PKP\oai\OAIUtils; -use PKP\submission\SubmissionKeywordDAO; -use PKP\submission\SubmissionSubjectDAO; +use PKP\submission\SubmissionKeywordVocab; +use PKP\submission\SubmissionSubjectVocab; class OAIMetadataFormat_RFC1807 extends OAIMetadataFormat { diff --git a/plugins/reports/articles/ArticleReportPlugin.php b/plugins/reports/articles/ArticleReportPlugin.php index 23117afb747..704ab9f9e4e 100644 --- a/plugins/reports/articles/ArticleReportPlugin.php +++ b/plugins/reports/articles/ArticleReportPlugin.php @@ -18,7 +18,6 @@ use APP\decision\Decision; use APP\facades\Repo; -use PKP\db\DAORegistry; use PKP\facades\Locale; use PKP\plugins\ReportPlugin; use PKP\security\Role; @@ -158,9 +157,9 @@ public function display($args, $request) $sectionTitles[$sectionId] = $section->getLocalizedTitle(); } - $subjects = $submissionSubjectDao->getSubjects($submission->getCurrentPublication()->getId()); - $disciplines = $submissionDisciplineDao->getDisciplines($submission->getCurrentPublication()->getId()); - $keywords = $submissionKeywordDao->getKeywords($submission->getCurrentPublication()->getId()); + $subjects = SubmissionSubjectVocab::getSubjects($submission->getCurrentPublication()->getId()); + $disciplines = SubmissionDisciplineVocab::getDisciplines($submission->getCurrentPublication()->getId()); + $keywords = SubmissionKeywordVocab::getKeywords($submission->getCurrentPublication()->getId()); $agencies = SubmissionAgencyVocab::getAgencies($submission->getCurrentPublication()->getId()); // Store the submission results diff --git a/tools/cleanReviewerInterests.php b/tools/cleanReviewerInterests.php index e395dac777b..c3375d0af0e 100755 --- a/tools/cleanReviewerInterests.php +++ b/tools/cleanReviewerInterests.php @@ -3,8 +3,8 @@ /** * @file tools/cleanReviewerInterests.php * - * Copyright (c) 2014-2021 Simon Fraser University - * Copyright (c) 2003-2021 John Willinsky + * Copyright (c) 2014-2024 Simon Fraser University + * Copyright (c) 2003-2024 John Willinsky * Distributed under the GNU GPL v3. For full terms see the file docs/COPYING. * * @class ReviewerInterestsDeletionTool @@ -17,10 +17,10 @@ require(dirname(__FILE__) . '/bootstrap.php'); use PKP\cliTool\CommandLineTool; -use PKP\controlledVocab\ControlledVocabDAO; +use PKP\controlledVocab\ControlledVocab; use PKP\controlledVocab\ControlledVocabEntryDAO; use PKP\db\DAORegistry; -use PKP\user\InterestDAO; +use PKP\user\UserInterest; class ReviewerInterestsDeletionTool extends CommandLineTool { @@ -57,7 +57,7 @@ public function usage() /** * Remove user interests that are not referenced by any user account */ - public function execute() + public function execute(): void { $orphans = $this->_getOrphanVocabInterests(); if (!count($orphans)) { @@ -69,7 +69,7 @@ public function execute() switch ($command) { case '--show': $interests = array_map(function ($entry) { - return $entry->getData(InterestDAO::CONTROLLED_VOCAB_INTEREST); + return $entry->getData(UserInterest::CONTROLLED_VOCAB_INTEREST); }, $orphans); echo "Below are the user interests that are not referenced by any user account.\n"; echo "\t" . join("\n\t", $interests) . "\n"; @@ -96,33 +96,23 @@ public function execute() * * @return array array of ControlledVocabEntry object */ - protected function _getOrphanVocabInterests() + protected function _getOrphanVocabInterests(): array { - /** @var InterestDAO */ - $interestDao = DAORegistry::getDAO('InterestDAO'); - /** @var ControlledVocabDAO */ - $vocabDao = DAORegistry::getDAO('ControlledVocabDAO'); - /** @var ControlledVocabEntryDAO */ + /** @var ControlledVocabEntryDAO $vocabEntryDao */ $vocabEntryDao = DAORegistry::getDAO('ControlledVocabEntryDAO'); - - $interestVocab = $vocabDao->getBySymbolic(InterestDAO::CONTROLLED_VOCAB_INTEREST); - $vocabEntryIterator = $vocabEntryDao->getByControlledVocabId($interestVocab->getId()); + $interestVocab = ControlledVocab::withSymbolic(UserInterest::CONTROLLED_VOCAB_INTEREST) + ->withAssoc(0, 0) + ->first(); + $vocabEntryIterator = $vocabEntryDao->getByControlledVocabId($interestVocab->id); $vocabEntryList = $vocabEntryIterator->toArray(); // list of vocab interests in db - $allInterestVocabIds = array_map( - function ($entry) { - return $entry->getId(); - }, - $vocabEntryList - ); + $allInterestVocabIds = array_map(fn ($entry) => $entry->getId(), $vocabEntryList); // list of vocabs associated to users - $interests = $interestDao->getAllInterests(); + $interests = UserInterest::getAllInterests(); $userInterestVocabIds = array_map( - function ($interest) { - return $interest->getId(); - }, + fn ($interest) => $interest->getId(), $interests->toArray() ); From 978d1ade77f4ef657368982236a804b1429e5de9 Mon Sep 17 00:00:00 2001 From: Touhidur Rahman Date: Tue, 20 Aug 2024 15:57:39 +0600 Subject: [PATCH 04/20] pkp/pkp-lib#10292 Submodule Update ##touhidurabir/i10292_main## --- .../dc/tests/OAIMetadataFormat_DCTest.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/plugins/oaiMetadataFormats/dc/tests/OAIMetadataFormat_DCTest.php b/plugins/oaiMetadataFormats/dc/tests/OAIMetadataFormat_DCTest.php index 9c15bbf0709..aac9d76e9b1 100755 --- a/plugins/oaiMetadataFormats/dc/tests/OAIMetadataFormat_DCTest.php +++ b/plugins/oaiMetadataFormats/dc/tests/OAIMetadataFormat_DCTest.php @@ -35,9 +35,11 @@ use APP\section\Section; use APP\submission\Submission; use Illuminate\Support\LazyCollection; +use Mockery; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\MockObject\MockObject; use PKP\author\Repository as AuthorRepository; +use PKP\controlledVocab\Repository as ControlledVocabRepository; use PKP\core\Dispatcher; use PKP\core\Registry; use PKP\db\DAORegistry; @@ -77,6 +79,19 @@ protected function getMockedContainerKeys(): array public function testToXml() { + $controlledVocabRepoMock = Mockery::mock(ControlledVocabRepository::class) + ->makePartial() + ->shouldReceive('getBySymbolic') + ->twice() + ->withAnyArgs() + ->andReturn( + ['en' => ['article-keyword']], + ['en' => ['article-subject', 'article-subject-class']] + ) + ->getMock(); + + app()->instance(ControlledVocabRepository::class, $controlledVocabRepoMock); + // // Create test data. // @@ -100,6 +115,7 @@ public function testToXml() $publication = $this->getMockBuilder(Publication::class) ->onlyMethods([]) ->getMock(); + $publication->setData('id', 0); $publication->setData('issueId', 96); $publication->setData('pages', 15); $publication->setData('type', 'art-type', 'en'); @@ -165,6 +181,7 @@ public function testToXml() ->willReturn(Journal::PUBLISHING_MODE_OPEN); $journal->setName('journal-title', 'en'); $journal->setData('publisherInstitution', 'journal-publisher'); + $journal->setData('supportedFormLocales', []); $journal->setPrimaryLocale('en'); $journal->setPath('journal-path'); $journal->setData('onlineIssn', 'onlineIssn'); From 90282a741aa22e9209a6c6c4e2f604a45b96d12a Mon Sep 17 00:00:00 2001 From: Touhidur Rahman Date: Tue, 20 Aug 2024 16:07:57 +0600 Subject: [PATCH 05/20] pkp/pkp-lib#10292 Submodule Update ##touhidurabir/i10292_main## --- plugins/generic/citationStyleLanguage | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/generic/citationStyleLanguage b/plugins/generic/citationStyleLanguage index c7e90faf16a..97c5752329e 160000 --- a/plugins/generic/citationStyleLanguage +++ b/plugins/generic/citationStyleLanguage @@ -1 +1 @@ -Subproject commit c7e90faf16ac230e1869bcf51c3beb89203113b8 +Subproject commit 97c5752329e4c5b7b01915b66e6e00c234eddab7 From b563d87e72dcec5a9d83a909806cfedeea724cca Mon Sep 17 00:00:00 2001 From: Touhidur Rahman Date: Tue, 20 Aug 2024 17:10:04 +0600 Subject: [PATCH 06/20] pkp/pkp-lib#10292 removed user_interests table primary key migration as already exist --- ...0292_AddPrimaryKeyToUserInterestsTable.php | 43 ------------------- 1 file changed, 43 deletions(-) delete mode 100644 classes/migration/upgrade/v3_5_0/I10292_AddPrimaryKeyToUserInterestsTable.php diff --git a/classes/migration/upgrade/v3_5_0/I10292_AddPrimaryKeyToUserInterestsTable.php b/classes/migration/upgrade/v3_5_0/I10292_AddPrimaryKeyToUserInterestsTable.php deleted file mode 100644 index 3d140eb2f4d..00000000000 --- a/classes/migration/upgrade/v3_5_0/I10292_AddPrimaryKeyToUserInterestsTable.php +++ /dev/null @@ -1,43 +0,0 @@ -bigIncrements('user_interest_id')->first(); - }); - } - - /** - * Reverse the migrations. - */ - public function down(): void - { - Schema::table('user_interests', function (Blueprint $table) { - $table->dropColumn('user_interest_id'); - }); - } -} From 8d5d78ba5f6bd9955fd138171d7715009e8fc71c Mon Sep 17 00:00:00 2001 From: Touhidur Rahman Date: Mon, 26 Aug 2024 15:43:17 +0600 Subject: [PATCH 07/20] pkp/pkp-lib#10292 Refactored user interest to model and repository --- tools/cleanReviewerInterests.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/cleanReviewerInterests.php b/tools/cleanReviewerInterests.php index c3375d0af0e..b15a11d8b15 100755 --- a/tools/cleanReviewerInterests.php +++ b/tools/cleanReviewerInterests.php @@ -16,11 +16,12 @@ require(dirname(__FILE__) . '/bootstrap.php'); +use APP\facades\Repo; use PKP\cliTool\CommandLineTool; use PKP\controlledVocab\ControlledVocab; use PKP\controlledVocab\ControlledVocabEntryDAO; use PKP\db\DAORegistry; -use PKP\user\UserInterest; +use PKP\user\interest\UserInterest; class ReviewerInterestsDeletionTool extends CommandLineTool { @@ -110,7 +111,7 @@ protected function _getOrphanVocabInterests(): array $allInterestVocabIds = array_map(fn ($entry) => $entry->getId(), $vocabEntryList); // list of vocabs associated to users - $interests = UserInterest::getAllInterests(); + $interests = Repo::userInterest()->getAllInterests(); $userInterestVocabIds = array_map( fn ($interest) => $interest->getId(), $interests->toArray() From 30e1914cdca3d5d2b2d0de127c6bfee3a2ab00f3 Mon Sep 17 00:00:00 2001 From: Touhidur Rahman Date: Mon, 26 Aug 2024 19:05:04 +0600 Subject: [PATCH 08/20] pkp/pkp-lib#10292 removed extended vocab classes --- classes/search/ArticleSearch.php | 10 ++++- .../doaj/filter/DOAJJsonFilter.php | 10 ++++- .../doaj/filter/DOAJXmlFilter.php | 9 ++++- .../dc11/filter/Dc11SchemaArticleAdapter.php | 17 +++++++-- .../rfc1807/OAIMetadataFormat_RFC1807.php | 28 +++++++------- .../reports/articles/ArticleReportPlugin.php | 37 +++++++++++++------ 6 files changed, 77 insertions(+), 34 deletions(-) diff --git a/classes/search/ArticleSearch.php b/classes/search/ArticleSearch.php index 4660b6d3870..b67453a5fb7 100644 --- a/classes/search/ArticleSearch.php +++ b/classes/search/ArticleSearch.php @@ -23,6 +23,7 @@ use APP\core\Request; use APP\facades\Repo; use APP\issue\IssueAction; +use PKP\controlledVocab\ControlledVocab; use PKP\db\DAORegistry; use PKP\facades\Locale; use PKP\plugins\Hook; @@ -334,7 +335,14 @@ public function getSimilarityTerms($submissionId) $article = Repo::submission()->get($submissionId); if ($article->getData('status') === PKPSubmission::STATUS_PUBLISHED) { // Retrieve keywords (if any). - $allSearchTerms = array_filter(SubmissionKeywordVocab::getKeywords($article->getCurrentPublication()->getId(), [Locale::getLocale(), $article->getData('locale'), Locale::getPrimaryLocale()])); + $allSearchTerms = array_filter( + Repo::controlledVocab()->getBySymbolic( + ControlledVocab::CONTROLLED_VOCAB_SUBMISSION_KEYWORD, + Application::ASSOC_TYPE_PUBLICATION, + $article->getCurrentPublication()->getId(), + [Locale::getLocale(), $article->getData('locale'), Locale::getPrimaryLocale()] + ) + ); foreach ($allSearchTerms as $locale => $localeSearchTerms) { $searchTerms += $localeSearchTerms; } diff --git a/plugins/importexport/doaj/filter/DOAJJsonFilter.php b/plugins/importexport/doaj/filter/DOAJJsonFilter.php index c4fa514d6af..ce0011000f8 100644 --- a/plugins/importexport/doaj/filter/DOAJJsonFilter.php +++ b/plugins/importexport/doaj/filter/DOAJJsonFilter.php @@ -20,9 +20,9 @@ use APP\facades\Repo; use APP\plugins\importexport\doaj\DOAJExportDeployment; use APP\plugins\importexport\doaj\DOAJExportPlugin; +use PKP\controlledVocab\ControlledVocab; use PKP\core\PKPString; use PKP\plugins\importexport\PKPImportExportFilter; -use PKP\submission\SubmissionKeywordVocab; class DOAJJsonFilter extends PKPImportExportFilter { @@ -175,7 +175,13 @@ public function &process(&$pubObject) $article['bibjson']['abstract'] = PKPString::html2text($abstract); } // Keywords - $keywords = SubmissionKeywordVocab::getKeywords($publication->getId(), [$publicationLocale]); + $keywords = Repo::controlledVocab()->getBySymbolic( + ControlledVocab::CONTROLLED_VOCAB_SUBMISSION_KEYWORD, + Application::ASSOC_TYPE_PUBLICATION, + $publication->getId(), + [$publicationLocale] + ); + $allowedNoOfKeywords = array_slice($keywords[$publicationLocale] ?? [], 0, 6); if (!empty($keywords[$publicationLocale])) { $article['bibjson']['keywords'] = $allowedNoOfKeywords; diff --git a/plugins/importexport/doaj/filter/DOAJXmlFilter.php b/plugins/importexport/doaj/filter/DOAJXmlFilter.php index 522ad0c7ea7..06624a950c3 100644 --- a/plugins/importexport/doaj/filter/DOAJXmlFilter.php +++ b/plugins/importexport/doaj/filter/DOAJXmlFilter.php @@ -20,9 +20,9 @@ use APP\plugins\importexport\doaj\DOAJExportPlugin; use APP\publication\Publication; use APP\submission\Submission; +use PKP\controlledVocab\ControlledVocab; use PKP\core\PKPString; use PKP\i18n\LocaleConversion; -use PKP\submission\SubmissionKeywordVocab; class DOAJXmlFilter extends \PKP\plugins\importexport\native\filter\NativeExportFilter { @@ -191,7 +191,12 @@ public function &process(&$pubObjects) // Keywords $supportedLocales = $context->getSupportedFormLocales(); - $articleKeywords = SubmissionKeywordVocab::getKeywords($publication->getId(), $supportedLocales); + $articleKeywords = Repo::controlledVocab()->getBySymbolic( + ControlledVocab::CONTROLLED_VOCAB_SUBMISSION_KEYWORD, + Application::ASSOC_TYPE_PUBLICATION, + $publication->getId(), + $supportedLocales + ); if (array_key_exists($publication->getData('locale'), $articleKeywords)) { $keywordsInArticleLocale = $articleKeywords[$publication->getData('locale')]; diff --git a/plugins/metadata/dc11/filter/Dc11SchemaArticleAdapter.php b/plugins/metadata/dc11/filter/Dc11SchemaArticleAdapter.php index ac5612e664f..653af06dd7b 100644 --- a/plugins/metadata/dc11/filter/Dc11SchemaArticleAdapter.php +++ b/plugins/metadata/dc11/filter/Dc11SchemaArticleAdapter.php @@ -28,6 +28,7 @@ use APP\oai\ojs\OAIDAO; use APP\plugins\PubIdPlugin; use APP\submission\Submission; +use PKP\controlledVocab\ControlledVocab; use PKP\core\PKPApplication; use PKP\db\DAORegistry; use PKP\facades\Locale; @@ -35,8 +36,6 @@ use PKP\metadata\MetadataDescription; use PKP\plugins\Hook; use PKP\plugins\PluginRegistry; -use PKP\submission\SubmissionKeywordVocab; -use PKP\submission\SubmissionSubjectVocab; class Dc11SchemaArticleAdapter extends MetadataDataObjectAdapter { @@ -92,8 +91,18 @@ public function &extractMetadataFromDataObject(&$article) // Subject $supportedLocales = $journal->getSupportedFormLocales(); $subjects = array_merge_recursive( - SubmissionKeywordVocab::getKeywords($publication->getId(), $supportedLocales), - SubmissionSubjectVocab::getSubjects($publication->getId(), $supportedLocales) + Repo::controlledVocab()->getBySymbolic( + ControlledVocab::CONTROLLED_VOCAB_SUBMISSION_KEYWORD, + Application::ASSOC_TYPE_PUBLICATION, + $publication->getId(), + $supportedLocales + ), + Repo::controlledVocab()->getBySymbolic( + ControlledVocab::CONTROLLED_VOCAB_SUBMISSION_SUBJECT, + Application::ASSOC_TYPE_PUBLICATION, + $publication->getId(), + $supportedLocales + ) ); $this->_addLocalizedElements($dc11Description, 'dc:subject', $subjects); diff --git a/plugins/oaiMetadataFormats/rfc1807/OAIMetadataFormat_RFC1807.php b/plugins/oaiMetadataFormats/rfc1807/OAIMetadataFormat_RFC1807.php index 8f79b124651..e61113f5205 100644 --- a/plugins/oaiMetadataFormats/rfc1807/OAIMetadataFormat_RFC1807.php +++ b/plugins/oaiMetadataFormats/rfc1807/OAIMetadataFormat_RFC1807.php @@ -18,16 +18,14 @@ use APP\core\Application; use APP\issue\Issue; -use APP\issue\IssueAction; use APP\journal\Journal; use APP\publication\Publication; -use APP\section\Section; use APP\submission\Submission; -use PKP\db\DAORegistry; +use APP\facades\Repo; +use APP\issue\IssueAction; +use PKP\controlledVocab\ControlledVocab; use PKP\oai\OAIMetadataFormat; use PKP\oai\OAIUtils; -use PKP\submission\SubmissionKeywordVocab; -use PKP\submission\SubmissionSubjectVocab; class OAIMetadataFormat_RFC1807 extends OAIMetadataFormat { @@ -79,15 +77,19 @@ public function toXml($record, $format = null) $supportedLocales = $journal->getSupportedFormLocales(); - /** @var SubmissionKeywordDAO $submissionKeywordDao */ - $submissionKeywordDao = DAORegistry::getDAO('SubmissionKeywordDAO'); - - /** @var SubmissionSubjectDAO $submissionSubjectDao */ - $submissionSubjectDao = DAORegistry::getDAO('SubmissionSubjectDAO'); - $subjects = array_merge_recursive( - (array) $submissionKeywordDao->getKeywords($publication->getId(), $supportedLocales), - (array) $submissionSubjectDao->getSubjects($publication->getId(), $supportedLocales) + Repo::controlledVocab()->getBySymbolic( + ControlledVocab::CONTROLLED_VOCAB_SUBMISSION_KEYWORD, + Application::ASSOC_TYPE_PUBLICATION, + $publication->getId(), + $supportedLocales + ), + Repo::controlledVocab()->getBySymbolic( + ControlledVocab::CONTROLLED_VOCAB_SUBMISSION_SUBJECT, + Application::ASSOC_TYPE_PUBLICATION, + $article->getCurrentPublication()->getId(), + $supportedLocales + ) ); $subject = $subjects[$journal->getPrimaryLocale()] ?? ''; diff --git a/plugins/reports/articles/ArticleReportPlugin.php b/plugins/reports/articles/ArticleReportPlugin.php index 704ab9f9e4e..f14c6da8e62 100644 --- a/plugins/reports/articles/ArticleReportPlugin.php +++ b/plugins/reports/articles/ArticleReportPlugin.php @@ -16,17 +16,15 @@ namespace APP\plugins\reports\articles; +use APP\core\Application; use APP\decision\Decision; use APP\facades\Repo; +use PKP\controlledVocab\ControlledVocab; use PKP\facades\Locale; use PKP\plugins\ReportPlugin; use PKP\security\Role; use PKP\stageAssignment\StageAssignment; use PKP\submission\PKPSubmission; -use PKP\submission\SubmissionAgencyVocab; -use PKP\submission\SubmissionDisciplineDAO; -use PKP\submission\SubmissionKeywordDAO; -use PKP\submission\SubmissionSubjectDAO; use PKP\userGroup\UserGroup; class ArticleReportPlugin extends ReportPlugin @@ -85,10 +83,6 @@ public function display($args, $request) // Add BOM (byte order mark) to fix UTF-8 in Excel fprintf($fp, chr(0xEF) . chr(0xBB) . chr(0xBF)); - $submissionKeywordDao = DAORegistry::getDAO('SubmissionKeywordDAO'); /** @var SubmissionKeywordDAO $submissionKeywordDao */ - $submissionSubjectDao = DAORegistry::getDAO('SubmissionSubjectDAO'); /** @var SubmissionSubjectDAO $submissionSubjectDao */ - $submissionDisciplineDao = DAORegistry::getDAO('SubmissionDisciplineDAO'); /** @var SubmissionDisciplineDAO $submissionDisciplineDao */ - $userGroups = UserGroup::withContextIds([$context->getId()]) ->get() ->all(); @@ -157,10 +151,29 @@ public function display($args, $request) $sectionTitles[$sectionId] = $section->getLocalizedTitle(); } - $subjects = SubmissionSubjectVocab::getSubjects($submission->getCurrentPublication()->getId()); - $disciplines = SubmissionDisciplineVocab::getDisciplines($submission->getCurrentPublication()->getId()); - $keywords = SubmissionKeywordVocab::getKeywords($submission->getCurrentPublication()->getId()); - $agencies = SubmissionAgencyVocab::getAgencies($submission->getCurrentPublication()->getId()); + $subjects = Repo::controlledVocab()->getBySymbolic( + ControlledVocab::CONTROLLED_VOCAB_SUBMISSION_SUBJECT, + Application::ASSOC_TYPE_PUBLICATION, + $submission->getCurrentPublication()->getId() + ); + + $disciplines = Repo::controlledVocab()->getBySymbolic( + ControlledVocab::CONTROLLED_VOCAB_SUBMISSION_DISCIPLINE, + Application::ASSOC_TYPE_PUBLICATION, + $submission->getCurrentPublication()->getId() + ); + + $keywords = Repo::controlledVocab()->getBySymbolic( + ControlledVocab::CONTROLLED_VOCAB_SUBMISSION_KEYWORD, + Application::ASSOC_TYPE_PUBLICATION, + $submission->getCurrentPublication()->getId() + ); + + $agencies = Repo::controlledVocab()->getBySymbolic( + ControlledVocab::CONTROLLED_VOCAB_SUBMISSION_AGENCY, + Application::ASSOC_TYPE_PUBLICATION, + $submission->getCurrentPublication()->getId() + ); // Store the submission results $results[] = [ From b0f7087e9a5e4772a7d2b5fca108ce4f273c6a1f Mon Sep 17 00:00:00 2001 From: Touhidur Rahman Date: Mon, 7 Oct 2024 16:29:16 +0600 Subject: [PATCH 09/20] pkp/pkp-lib#10292 refactored entry dao to model class --- tools/cleanReviewerInterests.php | 57 ++++++++------------------------ 1 file changed, 13 insertions(+), 44 deletions(-) diff --git a/tools/cleanReviewerInterests.php b/tools/cleanReviewerInterests.php index b15a11d8b15..ca161309b58 100755 --- a/tools/cleanReviewerInterests.php +++ b/tools/cleanReviewerInterests.php @@ -17,10 +17,9 @@ require(dirname(__FILE__) . '/bootstrap.php'); use APP\facades\Repo; +use Illuminate\Support\Collection; use PKP\cliTool\CommandLineTool; -use PKP\controlledVocab\ControlledVocab; -use PKP\controlledVocab\ControlledVocabEntryDAO; -use PKP\db\DAORegistry; +use PKP\controlledVocab\ControlledVocabEntry; use PKP\user\interest\UserInterest; class ReviewerInterestsDeletionTool extends CommandLineTool @@ -61,7 +60,7 @@ public function usage() public function execute(): void { $orphans = $this->_getOrphanVocabInterests(); - if (!count($orphans)) { + if ($orphans->count() === 0) { echo "No user interests to remove.\n"; exit(0); } @@ -69,20 +68,13 @@ public function execute(): void $command = $this->parameters[0]; switch ($command) { case '--show': - $interests = array_map(function ($entry) { - return $entry->getData(UserInterest::CONTROLLED_VOCAB_INTEREST); - }, $orphans); + $interests = $orphans->pluck(UserInterest::CONTROLLED_VOCAB_INTEREST)->toArray(); echo "Below are the user interests that are not referenced by any user account.\n"; echo "\t" . join("\n\t", $interests) . "\n"; break; case '--remove': - /** @var ControlledVocabEntryDAO */ - $vocabEntryDao = DAORegistry::getDAO('ControlledVocabEntryDAO'); - foreach ($orphans as $orphanVocab) { - $vocabEntryDao->deleteObject($orphanVocab); - } - echo count($orphans) . " entries deleted\n"; + echo $orphans->toQuery()->delete() . " entries deleted\n"; break; default: @@ -93,41 +85,18 @@ public function execute(): void } /** - * Returns user interests that are not referenced - * - * @return array array of ControlledVocabEntry object + * Returns user interests collection that are not referenced */ - protected function _getOrphanVocabInterests(): array + protected function _getOrphanVocabInterests(): Collection { - /** @var ControlledVocabEntryDAO $vocabEntryDao */ - $vocabEntryDao = DAORegistry::getDAO('ControlledVocabEntryDAO'); - $interestVocab = ControlledVocab::withSymbolic(UserInterest::CONTROLLED_VOCAB_INTEREST) - ->withAssoc(0, 0) - ->first(); - $vocabEntryIterator = $vocabEntryDao->getByControlledVocabId($interestVocab->id); - $vocabEntryList = $vocabEntryIterator->toArray(); - - // list of vocab interests in db - $allInterestVocabIds = array_map(fn ($entry) => $entry->getId(), $vocabEntryList); - - // list of vocabs associated to users - $interests = Repo::userInterest()->getAllInterests(); - $userInterestVocabIds = array_map( - fn ($interest) => $interest->getId(), - $interests->toArray() - ); - - // get the difference - $diff = array_diff($allInterestVocabIds, $userInterestVocabIds); - - $orphans = array_filter( - $vocabEntryList, - function ($entry) use ($diff) { - return in_array($entry->getId(), $diff); - } + $controlledVocab = Repo::controlledVocab()->build( + UserInterest::CONTROLLED_VOCAB_INTEREST ); - return $orphans; + return ControlledVocabEntry::query() + ->withControlledVocabId($controlledVocab->id) + ->whereDoesntHave('userInterest') + ->get(); } } From a2a6b0b9a042115f4b41fb2f5bda9faa49147e6d Mon Sep 17 00:00:00 2001 From: Touhidur Rahman Date: Mon, 7 Oct 2024 19:04:12 +0600 Subject: [PATCH 10/20] pkp/pkp-lib#10292 removed setting_type column --- dbscripts/xml/upgrade.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/dbscripts/xml/upgrade.xml b/dbscripts/xml/upgrade.xml index 2433aaceda1..41e729e0e48 100644 --- a/dbscripts/xml/upgrade.xml +++ b/dbscripts/xml/upgrade.xml @@ -154,6 +154,7 @@ + From 43f990cd3ad365f92e91b69f274c10a21b2914d8 Mon Sep 17 00:00:00 2001 From: Touhidur Rahman Date: Tue, 8 Oct 2024 15:52:01 +0600 Subject: [PATCH 11/20] pkp/pkp-lib#10292 Submodule Update ##touhidurabir/i10292_main## --- plugins/reports/reviewReport | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/reports/reviewReport b/plugins/reports/reviewReport index 14906b4ced0..0481ed0af93 160000 --- a/plugins/reports/reviewReport +++ b/plugins/reports/reviewReport @@ -1 +1 @@ -Subproject commit 14906b4ced04cbce66d6d8404a56bca9664b8d82 +Subproject commit 0481ed0af93d3cfb38431e4c755572775a397755 From 77186a909a4aa8224822c63c9dedd1a354c7f501 Mon Sep 17 00:00:00 2001 From: Touhidur Rahman Date: Fri, 15 Nov 2024 16:27:30 +0600 Subject: [PATCH 12/20] pkp/pkp-lib#10292 Submodule Update ##touhidurabir/i10292_main## --- plugins/generic/jatsTemplate | 2 +- plugins/oaiMetadataFormats/oaiJats | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/generic/jatsTemplate b/plugins/generic/jatsTemplate index 1d9cb8424a4..5057588d03c 160000 --- a/plugins/generic/jatsTemplate +++ b/plugins/generic/jatsTemplate @@ -1 +1 @@ -Subproject commit 1d9cb8424a4a21b37458d482ee7ab92539adb973 +Subproject commit 5057588d03c15c793b123e1cd5f36b4e4fdb25e5 diff --git a/plugins/oaiMetadataFormats/oaiJats b/plugins/oaiMetadataFormats/oaiJats index 51bf1b373ed..bf250afbe04 160000 --- a/plugins/oaiMetadataFormats/oaiJats +++ b/plugins/oaiMetadataFormats/oaiJats @@ -1 +1 @@ -Subproject commit 51bf1b373ed3ed275c7b904aa3ad564411431f7a +Subproject commit bf250afbe041c74c2342d372d5396b2425c0a125 From 93472b6889d30cf1d309effe9d3e5fa54f38fc98 Mon Sep 17 00:00:00 2001 From: Touhidur Rahman Date: Sun, 24 Nov 2024 16:23:14 +0600 Subject: [PATCH 13/20] pkp/pkp-lib#10292 migration to handle context based query --- ...ContextIdColumnToControlledVocabsTable.php | 35 +++++++++++++++++++ dbscripts/xml/upgrade.xml | 1 + 2 files changed, 36 insertions(+) create mode 100644 classes/migration/upgrade/v3_5_0/I10292_AddContextIdColumnToControlledVocabsTable.php diff --git a/classes/migration/upgrade/v3_5_0/I10292_AddContextIdColumnToControlledVocabsTable.php b/classes/migration/upgrade/v3_5_0/I10292_AddContextIdColumnToControlledVocabsTable.php new file mode 100644 index 00000000000..85533755b43 --- /dev/null +++ b/classes/migration/upgrade/v3_5_0/I10292_AddContextIdColumnToControlledVocabsTable.php @@ -0,0 +1,35 @@ + + From 5e3b4291726089227f5f3a2d967d798b0cf07e4e Mon Sep 17 00:00:00 2001 From: Touhidur Rahman Date: Mon, 25 Nov 2024 00:07:51 +0600 Subject: [PATCH 14/20] pkp/pkp-lib#10292 make context id required on controlled vocabs operations --- .../install/ControlledVocabMigration.php | 34 +++++++++++++++++++ dbscripts/xml/install.xml | 2 +- tools/cleanReviewerInterests.php | 5 ++- 3 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 classes/migration/install/ControlledVocabMigration.php diff --git a/classes/migration/install/ControlledVocabMigration.php b/classes/migration/install/ControlledVocabMigration.php new file mode 100644 index 00000000000..689d71a63cf --- /dev/null +++ b/classes/migration/install/ControlledVocabMigration.php @@ -0,0 +1,34 @@ + - + diff --git a/tools/cleanReviewerInterests.php b/tools/cleanReviewerInterests.php index ca161309b58..d127033cf19 100755 --- a/tools/cleanReviewerInterests.php +++ b/tools/cleanReviewerInterests.php @@ -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() From c8fb90936bc8edb3bb4968b4e126e1f7ae76dbfb Mon Sep 17 00:00:00 2001 From: Touhidur Rahman Date: Fri, 29 Nov 2024 12:59:05 +0600 Subject: [PATCH 15/20] pkp/pkp-lib#10292 revert back context id direct addition to vocabs --- .../install/ControlledVocabMigration.php | 34 ------------------ ...ContextIdColumnToControlledVocabsTable.php | 35 ------------------- dbscripts/xml/install.xml | 2 +- dbscripts/xml/upgrade.xml | 1 - tools/cleanReviewerInterests.php | 3 +- 5 files changed, 2 insertions(+), 73 deletions(-) delete mode 100644 classes/migration/install/ControlledVocabMigration.php delete mode 100644 classes/migration/upgrade/v3_5_0/I10292_AddContextIdColumnToControlledVocabsTable.php diff --git a/classes/migration/install/ControlledVocabMigration.php b/classes/migration/install/ControlledVocabMigration.php deleted file mode 100644 index 689d71a63cf..00000000000 --- a/classes/migration/install/ControlledVocabMigration.php +++ /dev/null @@ -1,34 +0,0 @@ - - + diff --git a/dbscripts/xml/upgrade.xml b/dbscripts/xml/upgrade.xml index 71c8f9390e9..41e729e0e48 100644 --- a/dbscripts/xml/upgrade.xml +++ b/dbscripts/xml/upgrade.xml @@ -155,7 +155,6 @@ - diff --git a/tools/cleanReviewerInterests.php b/tools/cleanReviewerInterests.php index d127033cf19..4cdab7fa952 100755 --- a/tools/cleanReviewerInterests.php +++ b/tools/cleanReviewerInterests.php @@ -92,8 +92,7 @@ protected function _getOrphanVocabInterests(): Collection $controlledVocab = Repo::controlledVocab()->build( UserInterest::CONTROLLED_VOCAB_INTEREST, UserInterest::CONTROLLED_VOCAB_INTEREST_ASSOC_TYPE, - UserInterest::CONTROLLED_VOCAB_INTEREST_ASSOC_ID, - UserInterest::CONTROLLED_VOCAB_INTEREST_CONTEXT_ID + UserInterest::CONTROLLED_VOCAB_INTEREST_ASSOC_ID ); return ControlledVocabEntry::query() From 6c036ebdce6afb806034391a0458319be5d92930 Mon Sep 17 00:00:00 2001 From: Touhidur Rahman Date: Tue, 17 Dec 2024 19:23:17 +0600 Subject: [PATCH 16/20] pkp/pkp-lib#10292 user interest assoc const refactor --- tools/cleanReviewerInterests.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/cleanReviewerInterests.php b/tools/cleanReviewerInterests.php index 4cdab7fa952..b5586923d55 100755 --- a/tools/cleanReviewerInterests.php +++ b/tools/cleanReviewerInterests.php @@ -16,6 +16,7 @@ require(dirname(__FILE__) . '/bootstrap.php'); +use APP\core\Application; use APP\facades\Repo; use Illuminate\Support\Collection; use PKP\cliTool\CommandLineTool; @@ -91,8 +92,8 @@ protected function _getOrphanVocabInterests(): Collection { $controlledVocab = Repo::controlledVocab()->build( UserInterest::CONTROLLED_VOCAB_INTEREST, - UserInterest::CONTROLLED_VOCAB_INTEREST_ASSOC_TYPE, - UserInterest::CONTROLLED_VOCAB_INTEREST_ASSOC_ID + Application::ASSOC_TYPE_SITE, + (int)Application::SITE_CONTEXT_ID, ); return ControlledVocabEntry::query() From d4ff9c35cdf7c697b7740b747ba1b778f00e9f6a Mon Sep 17 00:00:00 2001 From: Touhidur Rahman Date: Fri, 20 Dec 2024 14:51:36 +0600 Subject: [PATCH 17/20] pkp/pkp-lib#10292 controlled vocabs assoc id nullable --- dbscripts/xml/upgrade.xml | 1 + tools/cleanReviewerInterests.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/dbscripts/xml/upgrade.xml b/dbscripts/xml/upgrade.xml index 41e729e0e48..23cb679ec32 100644 --- a/dbscripts/xml/upgrade.xml +++ b/dbscripts/xml/upgrade.xml @@ -155,6 +155,7 @@ + diff --git a/tools/cleanReviewerInterests.php b/tools/cleanReviewerInterests.php index b5586923d55..b1859287768 100755 --- a/tools/cleanReviewerInterests.php +++ b/tools/cleanReviewerInterests.php @@ -93,7 +93,7 @@ protected function _getOrphanVocabInterests(): Collection $controlledVocab = Repo::controlledVocab()->build( UserInterest::CONTROLLED_VOCAB_INTEREST, Application::ASSOC_TYPE_SITE, - (int)Application::SITE_CONTEXT_ID, + Application::SITE_CONTEXT_ID, ); return ControlledVocabEntry::query() From 71ad353f762b7510382e3dba4b0a54abd947d9e3 Mon Sep 17 00:00:00 2001 From: Touhidur Rahman Date: Fri, 20 Dec 2024 18:59:39 +0600 Subject: [PATCH 18/20] pkp/pkp-lib#10292 migrated controlled vocabs setting name from symbolics to name --- dbscripts/xml/upgrade.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/dbscripts/xml/upgrade.xml b/dbscripts/xml/upgrade.xml index 23cb679ec32..25b9f06ad68 100644 --- a/dbscripts/xml/upgrade.xml +++ b/dbscripts/xml/upgrade.xml @@ -156,6 +156,7 @@ + From 65c725e0249f85f697c6021662cc56d240253d56 Mon Sep 17 00:00:00 2001 From: Touhidur Rahman Date: Fri, 20 Dec 2024 19:00:48 +0600 Subject: [PATCH 19/20] pkp/pkp-lib#10292 Submodule Update ##touhidurabir/i10292_main## --- plugins/oaiMetadataFormats/oaiJats | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/oaiMetadataFormats/oaiJats b/plugins/oaiMetadataFormats/oaiJats index bf250afbe04..ba44cdfa425 160000 --- a/plugins/oaiMetadataFormats/oaiJats +++ b/plugins/oaiMetadataFormats/oaiJats @@ -1 +1 @@ -Subproject commit bf250afbe041c74c2342d372d5396b2425c0a125 +Subproject commit ba44cdfa42596bf93e6ba454d58eaba796159474 From 8e0e42efc3c76cb332fa302be4882a2229e12a95 Mon Sep 17 00:00:00 2001 From: Touhidur Rahman Date: Fri, 20 Dec 2024 20:22:52 +0600 Subject: [PATCH 20/20] pkp/pkp-lib#10292 Submodule Update ##touhidurabir/i10292_main## --- plugins/generic/jatsTemplate | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/generic/jatsTemplate b/plugins/generic/jatsTemplate index 5057588d03c..578de22ea4c 160000 --- a/plugins/generic/jatsTemplate +++ b/plugins/generic/jatsTemplate @@ -1 +1 @@ -Subproject commit 5057588d03c15c793b123e1cd5f36b4e4fdb25e5 +Subproject commit 578de22ea4c97d678a7b0242ba09ec9f019b6578