Hi Natalia,
If this is the statement that is failing:
- Code: Select all
if ($issue && $issue->getPublished() && $publishedArticle->getStatus() == STATUS_PUBLISHED)
Then one of those three things is evaluating to false. So, either you do not have a valid issue at that point in the code, or the issue is not published, or the article you're attempting to look at is not published (or maybe it is, but the status is not STATUS_PUBLISHED).
So, three things we can look at.
Right before that if statement line, I suggest adding three lines of code.
- Code: Select all
error_log(var_export($issue, TRUE));
error_log('is issue published: ' . $issue->getPublished());
error_log('article status is: ' . $publishedArticle->getStatus());
Ideally, the first statement should generate a whole lot of lines, which indicates that you do indeed have an issue. The second line should print a '1' if the issue is published. The third line should print a '3', which is what the STATUS_PUBLISHED constant evaluates to. One of those things will not occur. Probably worth mentioning that if the first one is the problem, then the second one will generate a fatal error because you don't have an issue object to call getPublished() on.
The article status is stored in the articles database table in the status column. For published articles, it should be 3. Articles still going through the submission process are queued (2) and articles that have been archived have a status of 1. If you know the article id, you can probably make some test changes.
This is sounding like a bug during the upgrade process, where some articles may have not had their status changed to the correct value. There have been some changes to that part of the code and you did upgrade from a very old version of OJS.
Regards,
Jason