Coder Social home page Coder Social logo

googlescholar's People

Contributors

ajnyga avatar amirzoian avatar asmecher avatar bozana avatar ckamburov avatar defstat avatar jonasraoni avatar mhvezina avatar mirkospiroski avatar mpbraendle avatar natewr avatar osmndrmz avatar tigran54 avatar trungvjm avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

googlescholar's Issues

Fatal error when issue can't be found

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.