pkp / crossrefReferenceLinking

GNU General Public License v3.0
3 stars 15 forks source link

DOI not being fetched if called from CLI/scheduledTasks #24

Open mpbraendle opened 8 months ago

mpbraendle commented 8 months ago

In getCrossrefReferencesDOIs, the stored DOI is not fetched via $publication->getStoredPubId('doi') if the called from the CLI, e.g.

php tools/checkCrossrefReferencesDOIs.php submission #somesubmissionId

or via scheduledTasks, e.g.

# Run Crossref Reference linking job every hour
0 * * * *        /usr/bin/php {ojsroot}/tools/runScheduledTasks.php plugins/generic/crossrefReferenceLinking/scheduledTasks.xml

I think https://github.com/pkp/pkp-lib/issues/7194 bites here, too.

My current workaround is to fetch the DOI via $submission->getData('crossref::registeredDoi') .

Please check a possible solution.


PR (stable-3_3_0): https://github.com/pkp/crossrefReferenceLinking/pull/25

asmecher commented 8 months ago

@mpbraendle, I think I'd prefer an approach closer to https://github.com/pkp/ojs/pull/3173, probably added within the loops through all contexts directly in tools/checkCrossrefReferencesDOIs.php. But I'll tag @bozana for her thoughts too; she works with this more than I do!

bozana commented 7 months ago

@mpbraendle, what OJS and plugin version are you using?

bozana commented 7 months ago

I see it is relevant for stable-3_3_0 branch... I think in stable-3_4_0 it should not be a problem any more, because the DOIs are in core... I will provide a fix here...

bozana commented 7 months ago

@mpbraendle, could you maybe double check if this PR/changes solve the problem for you: https://github.com/pkp/crossrefReferenceLinking/pull/25?

mpbraendle commented 7 months ago

Will check asap.