I had a journal doing some odd things when viewing an article's pdf.
The journal is running OJS 2.3.8.
The editors reported, when clicking on a PDF on *SOME* articles it would show a blank page.
Upon further searching I noticed that it was random, only certain ones would do it, and sometimes that one would work.
I checked the usual suspects, restarted web server, restarted database, cleared caches, cleared template cache, etc.
It continued to happen. The page was entirely blank, source contained no lines of code.
I dug into that journal's error log:
PHP Fatal error: Call to a member function getDisableComments() on a non-object in /usr/local/journals/JOURNALNAME/htdocs/ojs-2.3.8/classes/article/Article.inc.php on line 445
So I opened classes/article/Article.inc.php
This is the function that's causing the error /classes/article/Article.inc.php from line 445 – 449. :
- Code: Select all
function getEnableComments() {
switch ($this->getCommentsStatus()) {
case COMMENTS_DISABLE:
return false;
case COMMENTS_ENABLE:
return true;
case COMMENTS_SECTION_DEFAULT:
$sectionDao =& DAORegistry::getDAO('SectionDAO');
$section =& $sectionDao->getSection($this->getSectionId(), $this->getJournalId(), true);
if ($section->getDisableComments()) {
return false;
} else {
return true;
}
}
}
I simply commented out that piece of it where the IF calls getDisableComments().
- Code: Select all
/* if ($section->getDisableComments()) {
return false;
} else { */
return true;
/* } */
They do not (at this point) have commenting enabled. The site still works (apparently) perfectly.
I can’t find a patch, or reference to this error.
For that matter, I can’t even figure out why it’s only an issue on THIS site and on SOME pages.
We've not had this occurrence on any of the other journals.
Any ideas as to why this is happening, or if keeping it commented until the next round of upgrades will hurt anything?
~J
