Hi @diegomejia07,
Something is happening here that I’m not spotting. The line of code you quote is
if ($this->galley && !$this->userCanViewGalley($request, $article->getId(), $this->galley->getId()))
…which is causing an error report of…
PHP Fatal error: Uncaught Error: Call to a member function getId() on null in /pages/article/ArticleHandler.inc.php:533
Stack trace:
#0 /pages/article/ArticleHandler.inc.php(216): ArticleHandler->userCanViewGalley(Object(Request), 14, 245)
#1 /lib/pkp/classes/core/PKPRouter.inc.php(391): ArticleHandler->view(Array, Object(Request))
#2 /lib/pkp/classes/core/PKPPageRouter.inc.php(231): PKPRouter->_authorizeInitializeAndCallRequest(Array, Object(Request), Array, false)
#3 /lib/pkp/classes/core/Dispatcher.inc.php(145): PKPPageRouter->route(Object(Request))
#4 /lib/pkp/classes/core/PKPApplication.inc.php(281): Dispatcher->dispatch(Object(Request))
#5 /index.php(68): PKPApplication->execute()
#6 {main}\n thrown in /pages/article/ArticleHandler.inc.php on line 533, referer: https://revistas.udea.edu.co/index.php/mutatismutandis/issue/view/4
The two calls to getId()
that could be causing the error are
-
$article->getId()
, and
$this->galley->getId()
The first is impossible because there is a function call on $article
a few lines above:
'currentPublication' => $article->getCurrentPublication(),
…and since this call didn’t generate an error, obviously $article
can’t be null
.
The second is also impossible because the if
contains the check:
if ($this->galley && ...
…ensuring that $this->galley
can’t be null
either.
Are you sure there’s not a modification of the code causing the problem? I note that the error message makes reference to pages/article/ArticleHandler.inc.php:533
– in OJS 3.2.1-4 that file is only 519 lines long.
What is line 533 of pages/article/ArticleHandler.inc.php
?
Regards,
Alec Smecher
Public Knowledge Project Team