OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



Random blank pages on pdf view.

Are you responsible for making OJS work -- installing, upgrading, migrating or troubleshooting? Do you think you've found a bug? Post in this forum.

Moderators: jmacgreg, btbell, michael, bdgregg, barbarah, asmecher

Forum rules
What to do if you have a technical problem with OJS:

1. Search the forum. You can do this from the Advanced Search Page or from our Google Custom Search, which will search the entire PKP site. If you are encountering an error, we especially recommend searching the forum for said error.

2. Check the FAQ to see if your question or error has already been resolved.

3. Post a question, but please, only after trying the above two solutions. If it's a workflow or usability question you should probably post to the OJS Editorial Support and Discussion subforum; if you have a development question, try the OJS Development subforum.

Random blank pages on pdf view.

Postby jheckman » Tue Mar 05, 2013 9:07 am

Friends,

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
jheckman
 
Posts: 12
Joined: Thu Nov 17, 2011 8:10 am
Location: Pittsburgh PA, USA

Re: Random blank pages on pdf view.

Postby asmecher » Tue Mar 05, 2013 9:56 am

Hi Jason,

I'm not sure that error message corresponds to your intermittent errors. I suspect it's caused by a database inconsistency -- an entry in "articles" that refers to a non-existent section_id in "sections" -- but that would cause an error message on every request for that article, not intermittently. I'd suggest correcting the data error and continuing to watch for a pattern in the requests, or other entries in the error logs.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 7698
Joined: Wed Aug 10, 2005 12:56 pm

Re: Random blank pages on pdf view.

Postby jheckman » Fri Mar 08, 2013 11:21 am

Alec,

We've had it pop up again on a completely separate OJS install. Same exact error.
Databases check out to be clean.

Thoughts?

~J
jheckman
 
Posts: 12
Joined: Thu Nov 17, 2011 8:10 am
Location: Pittsburgh PA, USA

Re: Random blank pages on pdf view.

Postby asmecher » Fri Mar 08, 2013 2:32 pm

Hi Jason,

Intermittent problems are hard to debug. Check your access logs (beyond of course your error logs); the content length should be logged for each response (depending on your logging configuration). Check for responses to the same request (e.g. PDF fetches) that look unexpectedly short; that will help to determine whether there is a PHP-side problem or it's something like a broken connection. Any patterns you're able to find would be very helpful.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 7698
Joined: Wed Aug 10, 2005 12:56 pm


Return to OJS Technical Support

Who is online

Users browsing this forum: No registered users and 5 guests