Skip to content

Commit

Permalink
Merge pull request #8986 from bozana/6293
Browse files Browse the repository at this point in the history
#6293 fix checkDuplicate in PKPPubIdPlugin
  • Loading branch information
bozana committed May 22, 2023
2 parents dc60449 + b9f5786 commit d41b321
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions classes/plugins/PKPPubIdPlugin.inc.php
Expand Up @@ -102,7 +102,7 @@ function manage($args, $request) {
/**
* Get the public identifier.
* @param $pubObject object
* Submission, Representation, SubmissionFile + OJS Issue
* Publication, Representation, SubmissionFile + OJS Issue + OMP Chapter
* @return string
*/
abstract function getPubId($pubObject);
Expand Down Expand Up @@ -258,7 +258,7 @@ function verifyData($fieldName, $fieldValue, $pubObject, $contextId, &$errorMsg)
if (empty($pubIdPrefix)) return true;
$newPubId = $this->constructPubId($pubIdPrefix, $fieldValue, $contextId);

if (!$this->checkDuplicate($newPubId, $pubObject->getId(), get_class($pubObject), $contextId)) {
if (!$this->checkDuplicate($newPubId, get_class($pubObject), $pubObject->getId(), $contextId)) {
$errorMsg = $this->getNotUniqueErrorMsg();
return false;
}
Expand All @@ -283,7 +283,6 @@ function validatePubId($pubId) {
function getDAOs() {
return array(
DAORegistry::getDAO('PublicationDAO'),
DAORegistry::getDAO('SubmissionDAO'),
Application::getRepresentationDAO(),
DAORegistry::getDAO('SubmissionFileDAO'),
);
Expand All @@ -292,7 +291,7 @@ function getDAOs() {
/**
* Can a pub id be assigned to the object.
* @param $pubObject object
* Submission, Representation, SubmissionFile + OJS Issue
* Publication, Representation, SubmissionFile + OJS Issue + OMP Chapter
* @return boolean
* false, if the pub id contains an unresolved pattern i.e. '%' or
* if the custom suffix is empty i.e. the pub id null.
Expand Down

0 comments on commit d41b321

Please sign in to comment.