diff --git a/cypress/tests/integration/Pubmed.cy.js b/cypress/tests/integration/Pubmed.cy.js
index 9988fec38bf..437abe028e6 100644
--- a/cypress/tests/integration/Pubmed.cy.js
+++ b/cypress/tests/integration/Pubmed.cy.js
@@ -18,7 +18,7 @@ describe('Pubmed tests', function () {
.then((win) => {
const csrfToken = win.pkp.currentUser.csrfToken;
cy.request({
- url: '/index.php/publicknowledge/management/importexport/plugin/PubMedExportPlugin/exportSubmissions',
+ url: '/index.php/publicknowledge/en/management/importexport/plugin/PubMedExportPlugin/exportSubmissions',
method: 'POST',
headers: {
'X-Csrf-Token': csrfToken
diff --git a/cypress/tests/integration/Z_ArticleViewDCMetadata.cy.js b/cypress/tests/integration/Z_ArticleViewDCMetadata.cy.js
index cfcde4ed50e..1b49ee62aa2 100644
--- a/cypress/tests/integration/Z_ArticleViewDCMetadata.cy.js
+++ b/cypress/tests/integration/Z_ArticleViewDCMetadata.cy.js
@@ -384,7 +384,7 @@ describe('Article View Metadata - DC Plugin', function() {
return cy.submitSubmissionWithApi(submission.id, this.csrfToken);
})
.then(xhr => {
- cy.visit('/index.php/publicknowledge/workflow/index/' + submission.id + '/1');
+ cy.visit('/index.php/publicknowledge/en/workflow/index/' + submission.id + '/1');
});
@@ -481,7 +481,7 @@ describe('Article View Metadata - DC Plugin', function() {
});
it('Tests if Header DC Metadata are present and consistent', function() {
- cy.visit('/index.php/publicknowledge/article/view/' + submission.urlPath);
+ cy.visit('/index.php/publicknowledge/en/article/view/' + submission.urlPath);
cy.get('meta[name^="DC."]').each((item, index, list) => {
cy.wrap(item)
diff --git a/lib/pkp b/lib/pkp
index 54e54ca0f73..101a0978d3c 160000
--- a/lib/pkp
+++ b/lib/pkp
@@ -1 +1 @@
-Subproject commit 54e54ca0f730ee02b35a47835738ba00b4d2e2c9
+Subproject commit 101a0978d3ccef52855916017d95bbaf75eef018
diff --git a/pages/user/index.php b/pages/user/index.php
index 3eed7a68315..b085689cbd8 100644
--- a/pages/user/index.php
+++ b/pages/user/index.php
@@ -23,7 +23,6 @@
//
case 'index':
case 'subscriptions':
- case 'setLocale':
case 'authorizationDenied':
case 'purchaseSubscription':
case 'payPurchaseSubscription':
diff --git a/plugins/blocks/languageToggle/LanguageToggleBlockPlugin.php b/plugins/blocks/languageToggle/LanguageToggleBlockPlugin.php
index 4e5b1e5b994..0bdef8503fb 100644
--- a/plugins/blocks/languageToggle/LanguageToggleBlockPlugin.php
+++ b/plugins/blocks/languageToggle/LanguageToggleBlockPlugin.php
@@ -85,10 +85,8 @@ public function getContents($templateMgr, $request = null)
$templateMgr->assign('languageToggleNoUser', true);
}
- if (!empty($locales)) {
- $templateMgr->assign('enableLanguageToggle', true);
- $templateMgr->assign('languageToggleLocales', $locales);
- }
+ $templateMgr->assign('enableLanguageToggle', count($locales) > 1);
+ $templateMgr->assign('languageToggleLocales', $locales);
return parent::getContents($templateMgr, $request);
}
diff --git a/plugins/blocks/languageToggle/templates/block.tpl b/plugins/blocks/languageToggle/templates/block.tpl
index 24cbc4d9832..4edd0ed1a02 100644
--- a/plugins/blocks/languageToggle/templates/block.tpl
+++ b/plugins/blocks/languageToggle/templates/block.tpl
@@ -17,7 +17,7 @@
{foreach from=$languageToggleLocales item=localeName key=localeKey}
-
-
+
{$localeName}
diff --git a/plugins/generic/citationStyleLanguage b/plugins/generic/citationStyleLanguage
index 71f3c570626..b612a20d657 160000
--- a/plugins/generic/citationStyleLanguage
+++ b/plugins/generic/citationStyleLanguage
@@ -1 +1 @@
-Subproject commit 71f3c570626be7c1b68eb11b2dc0c17adb466cc2
+Subproject commit b612a20d657bb4459ebe5365edc14827fccc0fa6
diff --git a/plugins/generic/crossref b/plugins/generic/crossref
index 501351ecf53..1fc8ce484fe 160000
--- a/plugins/generic/crossref
+++ b/plugins/generic/crossref
@@ -1 +1 @@
-Subproject commit 501351ecf5330793f41b60409530e731d03ce78a
+Subproject commit 1fc8ce484fe9c0748a2409b0fe5711f98b12a842
diff --git a/plugins/generic/datacite/DataciteExportPlugin.php b/plugins/generic/datacite/DataciteExportPlugin.php
index cfcb44b30a2..8c25383eada 100644
--- a/plugins/generic/datacite/DataciteExportPlugin.php
+++ b/plugins/generic/datacite/DataciteExportPlugin.php
@@ -410,13 +410,13 @@ public function _getObjectUrl($request, $context, $object)
$url = null;
switch (true) {
case $object instanceof Issue:
- $url = $dispatcher->url($request, PKPApplication::ROUTE_PAGE, $context->getPath(), 'issue', 'view', $object->getBestIssueId(), null, null, true);
+ $url = $dispatcher->url($request, PKPApplication::ROUTE_PAGE, $context->getPath(), 'issue', 'view', $object->getBestIssueId(), null, null, true, '');
break;
case $object instanceof Submission:
- $url = $dispatcher->url($request, PKPApplication::ROUTE_PAGE, $context->getPath(), 'article', 'view', $object->getBestId(), null, null, true);
+ $url = $dispatcher->url($request, PKPApplication::ROUTE_PAGE, $context->getPath(), 'article', 'view', $object->getBestId(), null, null, true, '');
break;
case $object instanceof Galley:
- $url = $dispatcher->url($request, PKPApplication::ROUTE_PAGE, $context->getPath(), 'article', 'view', [$article->getBestId(), $object->getBestGalleyId()], null, null, true);
+ $url = $dispatcher->url($request, PKPApplication::ROUTE_PAGE, $context->getPath(), 'article', 'view', [$article->getBestId(), $object->getBestGalleyId()], null, null, true, '');
break;
}
if ($this->isTestMode($context)) {
diff --git a/plugins/generic/datacite/filter/DataciteXmlFilter.php b/plugins/generic/datacite/filter/DataciteXmlFilter.php
index 6b282284b56..7abbe2047f7 100644
--- a/plugins/generic/datacite/filter/DataciteXmlFilter.php
+++ b/plugins/generic/datacite/filter/DataciteXmlFilter.php
@@ -821,7 +821,8 @@ public function createRelatedItemsNode($doc, $issue, $article, $publication, $pu
$contextUrl = $request->getDispatcher()->url(
$request,
Application::ROUTE_PAGE,
- $context->getPath()
+ $context->getPath(),
+ urlLocaleForPage: ''
);
$relatedItemIdentifierNode = $doc->createElementNS($deployment->getNamespace(), 'relatedItemIdentifier', $contextUrl);
$relatedItemIdentifierNode->setAttribute('relatedItemIdentifierType', DATACITE_IDTYPE_URL);
diff --git a/plugins/generic/dublinCoreMeta/DublinCoreMetaPlugin.php b/plugins/generic/dublinCoreMeta/DublinCoreMetaPlugin.php
index 2b376fd3247..2dc03987ac8 100644
--- a/plugins/generic/dublinCoreMeta/DublinCoreMetaPlugin.php
+++ b/plugins/generic/dublinCoreMeta/DublinCoreMetaPlugin.php
@@ -16,6 +16,7 @@
use APP\facades\Repo;
use APP\template\TemplateManager;
+use PKP\core\PKPApplication;
use PKP\plugins\GenericPlugin;
use PKP\plugins\Hook;
@@ -143,7 +144,7 @@ public function articleView($hookName, $args)
}
}
- $templateMgr->addHeader('dublinCoreUri', '');
+ $templateMgr->addHeader('dublinCoreUri', '');
$templateMgr->addHeader('dublinCoreLanguage', '');
@@ -166,7 +167,7 @@ public function articleView($hookName, $args)
$templateMgr->addHeader('dublinCoreVolume', '');
}
}
- $templateMgr->addHeader('dublinCoreSourceUri', '');
+ $templateMgr->addHeader('dublinCoreSourceUri', '');
if ($subjects = $publication->getData('subjects')) {
foreach ($subjects as $locale => $localeSubjects) {
diff --git a/plugins/generic/googleScholar b/plugins/generic/googleScholar
index d80e64607e8..69d72dd3584 160000
--- a/plugins/generic/googleScholar
+++ b/plugins/generic/googleScholar
@@ -1 +1 @@
-Subproject commit d80e64607e8f4c0c268afd9ecbfd42196495d4ba
+Subproject commit 69d72dd3584677c812dead47952007605e0b4638
diff --git a/plugins/generic/recommendByAuthor/templates/articleFooter.tpl b/plugins/generic/recommendByAuthor/templates/articleFooter.tpl
index 7324fe5c30c..80a32d350ca 100644
--- a/plugins/generic/recommendByAuthor/templates/articleFooter.tpl
+++ b/plugins/generic/recommendByAuthor/templates/articleFooter.tpl
@@ -26,11 +26,10 @@
{foreach from=$article->getCurrentPublication()->getData('authors') item=author}
{$author->getFullName()|escape},
{/foreach}
- g
-etBestId()}">
+ getBestId() urlLocaleForPage=""}">
{$publication->getLocalizedFullTitle(null, 'html')|strip_unsafe_html}
,
- getBestIssueId()}">
+ getBestIssueId() urlLocaleForPage=""}">
{$journal->getLocalizedName()|escape}: {$issue->getIssueIdentification()|escape}
diff --git a/plugins/generic/recommendBySimilarity/RecommendBySimilarityPlugin.php b/plugins/generic/recommendBySimilarity/RecommendBySimilarityPlugin.php
index 04f6f2df145..cc1d26d77ae 100644
--- a/plugins/generic/recommendBySimilarity/RecommendBySimilarityPlugin.php
+++ b/plugins/generic/recommendBySimilarity/RecommendBySimilarityPlugin.php
@@ -21,6 +21,7 @@
use APP\submission\Collector;
use APP\submission\Submission;
use APP\template\TemplateManager;
+use PKP\core\PKPApplication;
use PKP\plugins\GenericPlugin;
use PKP\plugins\Hook;
@@ -100,10 +101,10 @@ private function buildTemplate(): ?string
->getMany();
$nextPage = $rangeInfo->getPage() * $rangeInfo->getCount() < $submissionCount
- ? $request->url(path: $submissionId, params: ['articlesBySimilarityPage' => $rangeInfo->getPage() + 1])
+ ? $request->getDispatcher()->url($request, PKPApplication::ROUTE_PAGE, path: $submissionId, params: ['articlesBySimilarityPage' => $rangeInfo->getPage() + 1], urlLocaleForPage: '')
: null;
$previousPage = $rangeInfo->getPage() > 1
- ? $request->url(path: $submissionId, params: ['articlesBySimilarityPage' => $rangeInfo->getPage() - 1])
+ ? $request->getDispatcher()->url($request, PKPApplication::ROUTE_PAGE, path: $submissionId, params: ['articlesBySimilarityPage' => $rangeInfo->getPage() - 1], urlLocaleForPage: '')
: null;
$templateManager->assign('articlesBySimilarity', (object) [
diff --git a/plugins/generic/recommendBySimilarity/templates/articleFooter.tpl b/plugins/generic/recommendBySimilarity/templates/articleFooter.tpl
index 95c31759423..055199b809b 100644
--- a/plugins/generic/recommendBySimilarity/templates/articleFooter.tpl
+++ b/plugins/generic/recommendBySimilarity/templates/articleFooter.tpl
@@ -21,11 +21,11 @@
{foreach from=$publication->getData('authors') item=author}
{$author->getFullName()|escape},
{/foreach}
- getBestId()}">
+ getBestId() urlLocaleForPage=""}">
{$publication->getLocalizedFullTitle(null, 'html')|strip_unsafe_html}
{if $issue},
- getBestIssueId()}">
+ getBestIssueId() urlLocaleForPage=""}">
{$currentContext->getLocalizedName()|escape}: {$issue->getIssueIdentification()|escape}
{/if}
diff --git a/plugins/importexport/doaj/filter/DOAJJsonFilter.php b/plugins/importexport/doaj/filter/DOAJJsonFilter.php
index d141a3777d9..39e841ef9ae 100644
--- a/plugins/importexport/doaj/filter/DOAJJsonFilter.php
+++ b/plugins/importexport/doaj/filter/DOAJJsonFilter.php
@@ -148,7 +148,7 @@ public function &process(&$pubObject)
$request = Application::get()->getRequest();
$article['bibjson']['link'] = [];
$article['bibjson']['link'][] = [
- 'url' => $request->url($context->getPath(), 'article', 'view', $pubObject->getId()),
+ 'url' => $request->getDispatcher()->url($request, Application::ROUTE_PAGE, $context->getPath(), 'article', 'view', $pubObject->getId(), urlLocaleForPage: ''),
'type' => 'fulltext',
'content_type' => 'html'
];
diff --git a/plugins/importexport/doaj/filter/DOAJXmlFilter.php b/plugins/importexport/doaj/filter/DOAJXmlFilter.php
index 9b21273b15e..a0352273d68 100644
--- a/plugins/importexport/doaj/filter/DOAJXmlFilter.php
+++ b/plugins/importexport/doaj/filter/DOAJXmlFilter.php
@@ -187,7 +187,7 @@ public function &process(&$pubObjects)
}
// FullText URL
$request = Application::get()->getRequest();
- $recordNode->appendChild($node = $doc->createElement('fullTextUrl', htmlspecialchars($request->url(null, 'article', 'view', $pubObject->getId()), ENT_COMPAT, 'UTF-8')));
+ $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();
diff --git a/plugins/importexport/pubmed/PubMedExportPlugin.php b/plugins/importexport/pubmed/PubMedExportPlugin.php
index a8b9f63e634..55af5f0ed61 100644
--- a/plugins/importexport/pubmed/PubMedExportPlugin.php
+++ b/plugins/importexport/pubmed/PubMedExportPlugin.php
@@ -166,7 +166,11 @@ public function exportSubmissions($submissionIds, $context, $user)
return $a->level == LIBXML_ERR_ERROR || $a->level == LIBXML_ERR_FATAL;
});
if (!empty($errors)) {
- $this->displayXMLValidationErrors($errors, $xml);
+ try {
+ $this->displayXMLValidationErrors($errors, $xml);
+ } catch (Exception $e) {
+ error_log($e->getMessage());
+ }
}
return $xml;
}
diff --git a/plugins/metadata/dc11/filter/Dc11SchemaArticleAdapter.php b/plugins/metadata/dc11/filter/Dc11SchemaArticleAdapter.php
index baeddfaca8e..c084c17eb2c 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\core\PKPApplication;
use PKP\db\DAORegistry;
use PKP\facades\Locale;
use PKP\metadata\MetadataDataObjectAdapter;
@@ -151,7 +152,7 @@ public function &extractMetadataFromDataObject(&$article)
$request = Application::get()->getRequest();
$includeUrls = $journal->getSetting('publishingMode') != Journal::PUBLISHING_MODE_NONE || $issueAction->subscribedUser($request->getUser(), $journal, null, $article->getId());
if ($includeUrls) {
- $dc11Description->addStatement('dc:identifier', $request->url($journal->getPath(), 'article', 'view', [$article->getBestId()]));
+ $dc11Description->addStatement('dc:identifier', $request->getDispatcher()->url($request, PKPApplication::ROUTE_PAGE, null, 'article', 'view', [$article->getBestId()], urlLocaleForPage: ''));
}
// Source (journal title, issue id and pages)
@@ -184,7 +185,7 @@ public function &extractMetadataFromDataObject(&$article)
// full text URLs
if ($includeUrls) {
foreach ($galleys as $galley) {
- $relation = $request->url($journal->getPath(), 'article', 'view', [$article->getBestId(), $galley->getBestGalleyId()]);
+ $relation = $request->getDispatcher()->url($request, PKPApplication::ROUTE_PAGE, null, 'article', 'view', [$article->getBestId(), $galley->getBestGalleyId()], urlLocaleForPage: '');
$dc11Description->addStatement('dc:relation', $relation);
}
}
diff --git a/plugins/oaiMetadataFormats/dc/tests/OAIMetadataFormat_DCTest.php b/plugins/oaiMetadataFormats/dc/tests/OAIMetadataFormat_DCTest.php
index 8c628cf77a9..24fbe8bf027 100755
--- a/plugins/oaiMetadataFormats/dc/tests/OAIMetadataFormat_DCTest.php
+++ b/plugins/oaiMetadataFormats/dc/tests/OAIMetadataFormat_DCTest.php
@@ -37,6 +37,7 @@
use Illuminate\Support\LazyCollection;
use PHPUnit\Framework\MockObject\MockObject;
use PKP\author\Repository as AuthorRepository;
+use PKP\core\Dispatcher;
use PKP\core\Registry;
use PKP\db\DAORegistry;
use PKP\doi\Doi;
@@ -213,13 +214,25 @@ public function testToXml()
->method('url')
->will($this->returnCallback(fn ($request, $newContext = null, $handler = null, $op = null, $path = null) => $handler . '-' . $op . '-' . implode('-', $path)));
+ // Dispatcher
+ /** @var Dispatcher|MockObject */
+ $dispatcher = $this->getMockBuilder(Dispatcher::class)
+ ->onlyMethods(['url'])
+ ->getMock();
+ $dispatcher->expects($this->any())
+ ->method('url')
+ ->will($this->returnCallback(fn ($request, $shortcut, $newContext = null, $handler = null, $op = null, $path = null) => $handler . '-' . $op . '-' . implode('-', $path)));
+
// Request
$requestMock = $this->getMockBuilder(Request::class)
- ->onlyMethods(['getRouter'])
+ ->onlyMethods(['getRouter', 'getDispatcher'])
->getMock();
$requestMock->expects($this->any())
->method('getRouter')
->will($this->returnValue($router));
+ $requestMock->expects($this->any())
+ ->method('getDispatcher')
+ ->will($this->returnValue($dispatcher));
Registry::set('request', $requestMock);
//
diff --git a/plugins/oaiMetadataFormats/marc/templates/record.tpl b/plugins/oaiMetadataFormats/marc/templates/record.tpl
index 84311bc15d2..1436332e5d7 100644
--- a/plugins/oaiMetadataFormats/marc/templates/record.tpl
+++ b/plugins/oaiMetadataFormats/marc/templates/record.tpl
@@ -69,7 +69,7 @@
{/foreach}
- {url journal=$journal->getPath() page="article" op="view" path=$article->getBestId()|escape}
+ {url router=\PKP\core\PKPApplication::ROUTE_PAGE journal=$journal->getPath() page="article" op="view" path=$article->getBestId()|escape urlLocaleForPage=""}
diff --git a/plugins/oaiMetadataFormats/marcxml/templates/record.tpl b/plugins/oaiMetadataFormats/marcxml/templates/record.tpl
index 85e9014ded0..9e201f995b1 100644
--- a/plugins/oaiMetadataFormats/marcxml/templates/record.tpl
+++ b/plugins/oaiMetadataFormats/marcxml/templates/record.tpl
@@ -78,7 +78,7 @@
{/foreach}
- {url journal=$journal->getPath() page="article" op="view" path=$article->getBestId()|escape}
+ {url router=\PKP\core\PKPApplication::ROUTE_PAGE journal=$journal->getPath() page="article" op="view" path=$article->getBestId()|escape urlLocaleForPage=""}
diff --git a/plugins/oaiMetadataFormats/rfc1807/OAIMetadataFormat_RFC1807.php b/plugins/oaiMetadataFormats/rfc1807/OAIMetadataFormat_RFC1807.php
index 3d9aea067c5..e474187493b 100644
--- a/plugins/oaiMetadataFormats/rfc1807/OAIMetadataFormat_RFC1807.php
+++ b/plugins/oaiMetadataFormats/rfc1807/OAIMetadataFormat_RFC1807.php
@@ -81,7 +81,7 @@ public function toXml($record, $format = null)
$issueAction = new IssueAction();
$request = Application::get()->getRequest();
- $url = $request->url($journal->getPath(), 'article', 'view', [$article->getBestId()]);
+ $url = $request->getDispatcher()->url($request, Application::ROUTE_PAGE, $journal->getPath(), 'article', 'view', [$article->getBestId()], urlLocaleForPage: '');
$includeUrls = $journal->getSetting('publishingMode') != \APP\journal\Journal::PUBLISHING_MODE_NONE || $issueAction->subscribedUser($request->getUser(), $journal, null, $article->getId());
$response = "