pkp / googlescholar Goto Github PK
View Code? Open in Web Editor NEWExposes OJS and OPS metadata to Google Scholar for harvesting.
License: GNU General Public License v3.0
Exposes OJS and OPS metadata to Google Scholar for harvesting.
License: GNU General Public License v3.0
The error is:
PHP Fatal error: Uncaught Error: Call to a member function getYear() on null in /var/www/ojs/plugins/generic/googleScholar/GoogleScholarPlugin.inc.ph p:102\nStack trace:\n#0 /var/www/ojs/lib/pkp/classes/plugins/HookRegistry.inc.php(107): GoogleScholarPlugin->submissionView('ArticleHandler:...', Array)\n#1 /var/www/ojs/pages/article/ArticleHandler.inc.php(280): HookRegistry::call('Arti cleHandler:...', Array)\n
This causes a HTTP500 for any articles for which $issue is not defined.
This is the line causing the problem:
if (is_a($submission, 'Submission') && ($datePublished = $submission->getDatePublished()) && (!$issue->getYear() || $issue->getYear() == strftime('%Y', strtotime($datePublished)))) {
Our fix was to move the following line:
if ($issue) {
up from where it appears 7 lines below so that the section 111-122 appears as:
if ($issue) { if (is_a($submission, 'Submission') && ($datePublished = $submission->getDatePublished()) && (!$issue->getYear() || $issue->getYear() == strftime('%Y', strtotime($datePublished)))) { $templateMgr->addHeader('googleScholarDate', '<meta name="citation_date" content="' . strftime('%Y/%m/%d', strtotime($datePublished)) . '"/>'); } elseif ($issue && $issue->getYear()) { $templateMgr->addHeader('googleScholarDate', '<meta name="citation_date" content="' . htmlspecialchars($issue->getYear()) . '"/>'); } elseif ($issue && ($datePublished = $issue->getDatePublished())) { $templateMgr->addHeader('googleScholarDate', '<meta name="citation_date" content="' . strftime('%Y/%m/%d', strtotime($datePublished)) . '"/>'); } if ($issue->getShowVolume()) $templateMgr->addHeader('googleScholarVolume', '<meta name="citation_volume" content="' . htmlspecialchars($issue->getVolume()) . '"/>'); if ($issue->getShowNumber()) $templateMgr->addHeader('googleScholarNumber', '<meta name="citation_issue" content="' . htmlspecialchars($issue->getNumber()) . '"/>'); }
Ideally, wouldn't want this overwritten in a future release and so posting it up here so it can be considered for future versions
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.