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

Some article causing fatal error. #61

Closed
rahmanramsi opened this issue Jul 23, 2021 · 5 comments
Closed

Some article causing fatal error. #61

rahmanramsi opened this issue Jul 23, 2021 · 5 comments

Comments

@rahmanramsi
Copy link
Contributor

PHP Fatal error: Uncaught Error: Call to a member function getCategory() on null in /var/www/html/gas/plugins/generic/jatsParser/JatsParserPlugin.inc.php:778

Full stack trace : PHP Fatal error: Uncaught Error: Call to a member function getCategory() on null in /var/www/html/gas/plugins/generic/jatsParser/JatsParserPlugin.inc.php:778\nStack trace:\n#0 /var/www/html/gas/plugins/generic/jatsParser/JatsParserPlugin.inc.php(745): JatsParserPlugin->_setSupplImgPath()\n#1 /var/www/html/gas/lib/pkp/classes/plugins/HookRegistry.inc.php(107): JatsParserPlugin->displayFullText()\n#2 /var/www/html/gas/lib/pkp/classes/template/PKPTemplateManager.inc.php(1518): HookRegistry::call()\n#3 /var/www/html/gas/cache/t_compile/20ced12b90181983811d6a2d3549ed558a082564^336dc0f1b5d798bf1eac48afc5cf61399e302932_0.app.frontendobjectsarticledet.php(197): PKPTemplateManager->smartyCallHook()\n#4 /var/www/html/gas/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_template_resource_base.php(123): content_60f92c1ca7da66_11928898()\n#5 /var/www/html/gas/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_template_compiled.php(114): Smarty_Template_Resource_Base->getRenderedTemplateCode()\n#6 /var/www/html/gas/lib/pkp/lib/vendor/s in /var/www/html/gas/plugins/generic/jatsParser/JatsParserPlugin.inc.php on line 778

@Vitaliy-1
Copy link
Owner

Hi @rahmanramsi,

Please indicate the version of OJS and JATS Parser Plugin you are using.

@rahmanramsi
Copy link
Contributor Author

OJS Version : 3.3.0-7
JATS Parser Plugin Version : 2.1.9-3

@Vitaliy-1
Copy link
Owner

Looks like one of the dependent files of the submission file doesn't have genre. I don't think that this can happen under normal circumstances. You can find the list of genres in the genres table. I'm retrieving it here to identify if the dependent file is an image:

$genre = $genreDao->getById($dependentFile->getData('genreId'));
. In your case it returns null on one of the files.
I'd check those dependent files first, I mean why they don't have genre assigned but for the plugin it's relatively easy do bypass by changing the line
if ($genre->getCategory() !== GENRE_CATEGORY_ARTWORK) continue; // only art works are supported
to

if ($genre && $genre->getCategory() !== GENRE_CATEGORY_ARTWORK) continue; // only art works are supported. 

If this works, I'd be appreciate for the PR.

@rahmanramsi
Copy link
Contributor Author

yes it works. I will make PR for this issue

Vitaliy-1 added a commit that referenced this issue Jul 28, 2021
add check for genre availability #61
@Vitaliy-1
Copy link
Owner

Thanks for confirming

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

No branches or pull requests

2 participants