Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pkp/pkp-lib#7222 Use default landing page url for current publication #9

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ajnyga
Copy link
Contributor

@ajnyga ajnyga commented Feb 25, 2022

@ajnyga
Copy link
Contributor Author

ajnyga commented Feb 26, 2022

oh, noticed I need a continue instead of break there. Will fix that.

@asmecher
Copy link
Member

Nate, I think you're already active on this one.

filter/PreprintCrossrefXmlFilter.inc.php Outdated Show resolved Hide resolved
filter/PreprintCrossrefXmlFilter.inc.php Outdated Show resolved Hide resolved
@ajnyga
Copy link
Contributor Author

ajnyga commented Jul 1, 2022

With this change, the current publication DOI will have the default landing page url instead of an url pointing to a specific version. This will fix the problem with google scholar plugin and will be more consistent with the other Crossref plugins.

Currently DOI versioning is not supported in OPS main branch, but issue is raised here pkp/pkp-lib#8027

if ($submission->getCurrentPublication()->getId() === $publication->getId()) {
$url = $dispatcher->url($request, Application::ROUTE_PAGE, null, 'preprint', 'view', $submission->getBestId());
} else {
$url = $dispatcher->url($request, Application::ROUTE_PAGE, null, 'preprint', 'view', [$submission->getBestId(), 'version', $publication->getId()], null, null, true);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure but this might break when the code is run as part of an API request (which might be the case with the new changes). The reason is that when specifying a route type (Application::ROUTE_PAGE) that doesn't match the current request, I think it requires a context path to be passed.

It looks like you've already got a $context in this method, so you should be able to replace the null right after ROUTE_PAGE with $context->getPath(). But you might want to test it first.

@ajnyga
Copy link
Contributor Author

ajnyga commented Jul 15, 2022

Not sure if this should be put on hold until it is decided whether to have DOI versioning or not?

If we do not have DOI versioning, then the DOI will always just point to the latest version landing page and the original problem here is solved. We can also make the whole filter a lot simpler, because it will just provide the information for the latest publication.

@NateWr
Copy link
Member

NateWr commented Jul 18, 2022

Yeah let's see what happens in the discussion for pkp/pkp-lib#8027.

@ajnyga
Copy link
Contributor Author

ajnyga commented Aug 7, 2022

Did you make a decision about the versioning?

@NateWr
Copy link
Member

NateWr commented Aug 8, 2022

Yes, we decided to remove the feature to automatically generate a new DOI for each version. I believe support for the %b variable has just been removed.

@ajnyga
Copy link
Contributor Author

ajnyga commented Aug 10, 2022

ok, so basically in that case we just want to have
$postedContentNode = $this->createPostedContentNode($doc, $pubObject->getCurrentPublication(), $pubObject);
and no looping through other versions. Also we can remove the intraWork relations that deal with versions.

Right?

@NateWr
Copy link
Member

NateWr commented Aug 10, 2022

@ajnyga I'm not sure. It's still possible to assign different DOIs to two versions of the same publication. The only thing we settled on was removing the automatic creation of a different DOI for each version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants