Article preview problem (OJS 3.4.0.5)

Hello to everyone who is in the know.

How to fix it?

When using the bootstrap3 theme (version 3.4.0.1) in OJS (version 3.4.0.5), I encountered one strange problem:
When I try to open the article details (Article Title) through the preview via Dashboard (Issues → Future Issues → Preview→ Article Title), the browser displays a blank page (Mozilla), the browser (Google Chrome) returns HTTP ERROR 500.
At the same time, if you use the default theme, everything works fine and the browser displays the necessary detailed information of the article (abstract, etc.) through the same Dashboard path (Issues → Future Issues → Preview → Article Title).
I found the following errors in the PHP server error logs:


thrown in /home/np433659/ser.net.ua/www/lib/pkp/classes/plugins/PKPPubIdPlugin.php on line 511
#21 {main}
#20 /home/np433659/ser.net.ua/www/index.php(21): PKP\core\PKPApplication->execute()
#19 /home/np433659/ser.net.ua/www/lib/pkp/classes/core/PKPApplication.php(388): PKP\core\Dispatcher->dispatch(Object(APP\core\Request))
#18 /home/np433659/ser.net.ua/www/lib/pkp/classes/core/Dispatcher.php(165): PKP\core\PKPPageRouter->route(Object(APP\core\Request))
#17 /home/np433659/ser.net.ua/www/lib/pkp/classes/core/PKPPageRouter.php(277): PKP\core\PKPRouter->_authorizeInitializeAndCallRequest(Array, Object(APP\core\Request), Array, false)
#16 /home/np433659/ser.net.ua/www/lib/pkp/classes/core/PKPRouter.php(334): call_user_func(Array, Array, Object(APP\core\Request))
#15 [internal function]: APP\pages\issue\IssueHandler->view(Array, Object(APP\core\Request))
#14 /home/np433659/ser.net.ua/www/pages/issue/IssueHandler.php(138): PKP\template\PKPTemplateManager->display(‘frontend/pages/…’)
#13 /home/np433659/ser.net.ua/www/lib/pkp/classes/template/PKPTemplateManager.php(1368): Smarty_Internal_TemplateBase->display(‘frontend/pages/…’, NULL, ‘e35ba3ad88c8e24…’, NULL)
#12 /home/np433659/ser.net.ua/www/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php(134): Smarty_Internal_TemplateBase->_execute(Object(Smarty_Internal_Template), NULL, ‘e35ba3ad88c8e24…’, NULL, 1)
#11 /home/np433659/ser.net.ua/www/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_templatebase.php(238): Smarty_Internal_Template->render(false, 1)
#10 /home/np433659/ser.net.ua/www/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php(217): Smarty_Template_Compiled->render(Object(Smarty_Internal_Template))
#9 /home/np433659/ser.net.ua/www/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_template_compiled.php(114): Smarty_Template_Resource_Base->getRenderedTemplateCode(Object(Smarty_Internal_Template))
#8 /home/np433659/ser.net.ua/www/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_template_resource_base.php(123): content_65ec46301fa276_56308197(Object(Smarty_Internal_Template))
#7 /home/np433659/ser.net.ua/www/cache/t_compile/e35ba3ad88c8e24bc4de57abe8230f54bf65149d^fcbc2cabc0d4dff6219d7e4b5d36c1363533cfd8_0.app.frontendpagesissue.tpl.php(43): Smarty_Internal_Template->_subTemplateRender(‘app:frontend/ob…’, NULL, ‘e35ba3ad88c8e24…’, 0, 3600, Array, 0, false)
#6 /home/np433659/ser.net.ua/www/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php(386): Smarty_Internal_Template->render()
#5 /home/np433659/ser.net.ua/www/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php(217): Smarty_Template_Compiled->render(Object(Smarty_Internal_Template))
#4 /home/np433659/ser.net.ua/www/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_template_compiled.php(114): Smarty_Template_Resource_Base->getRenderedTemplateCode(Object(Smarty_Internal_Template))
#3 /home/np433659/ser.net.ua/www/lib/pkp/lib/vendor/smarty/smarty/libs/sysplugins/smarty_template_resource_base.php(123): content_65ec4630297204_87235674(Object(Smarty_Internal_Template))
#2 /home/np433659/ser.net.ua/www/cache/t_compile/e35ba3ad88c8e24bc4de57abe8230f54bf65149d^26de9c47ced54328a8eb56e39bb4d4079aa049c6_0.app.frontendobjectsissue_toc.tpl.php(71): APP\plugins\PubIdPlugin->getPubId(Object(APP\issue\Issue))
#1 /home/np433659/ser.net.ua/www/classes/plugins/PubIdPlugin.php(200): PKP\plugins\PKPPubIdPlugin->getContext(NULL)
#0 /home/np433659/ser.net.ua/www/lib/pkp/classes/plugins/PKPPubIdPlugin.php(511): assert(false, ‘assert(is_numer…’)
Best regadrs, Pirate

This error is returned by the 452 thread PKPPubIdPlugin.php, namely:

public function getPubObjectType($pubObject)
{
$allowedTypes = $this->getPubObjectTypes();
$pubObjectType = null;
foreach ($allowedTypes as $type => $fqcn) {
if ($pubObject instanceof $fqcn) {
$pubObjectType = $type;
break;
}
}
if (is_null($pubObjectType)) {
// This must be a dev error, so bail with an assertion.
assert(false);
return null;
}
return $pubObjectType;
}
It is suspected that the current Bootstrap theme has some conflict that results in a fatal error. Can anyone help?

An error occurred when calling the getPubObjectType() method in the PKPPubIdPlugin.php file. Probably the problem is related to incorrect arguments passed to this method.

Any ideas how to fix?

It is already clear that this is a problem with the bootstrap3 theme. Unfortunately, I haven’t found a solution yet, but it seems that the error is caused by incorrect styles.
I’ve attached screenshots of when the error occurs.


Maybe this will help those who will face the same error. I have fully analyzed the code of the bootstrap3 theme and the PKPPubIdPlugin.php plugin - the error is not related to the bootstrap3 theme, as I thought in previous posts, but to another plugin -
URN. It is active by default in the OJS system. When generating a preview of an article or issue, an error occurs that indicates that the code expects a boolean value of true (there is an error in the URN plugin code), but actually gets false, which leads to a failure with the assert(false) statement on line 452 in the PKPPubIdPlugin.php file.
As a temporary solution, disable the URN plugin and PKPPubIdPlugin.php will work properly with the bootstrap3 theme.
I am still analyzing the URN plugin code. Perhaps the developers will fix this bug if they pay attention to my post. Thanks to everyone who read my post.
Sincerely-.
Pirate

1 Like

Hi @Pirate

Hmmm… I unfortunately cannot reproduce the error – if I enable the URN plugin and use the bootstrap3 theme, I see everything correctly… :thinking:

The URN plugin is not enabled per default.

However, glad you find the solution for you!

Thanks,
Bozana

Same peoblem with mine. And srill couldn find the solution.