Problem OJS 2.4.8-1 Archive redirect to index

Hi, I am having problems with OJS 2.4.8-1 version, there are some previous issues with problematic articles, when I try open I am redirected to index of that journal, but if I am logged in the journal it works normally… If you know what is the problem I am very grateful if I share the solution

Hi @leoto17,

See e.g. this thread from our old forum.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi, first that all thank for your answers but I still have the problem, I saw it days ago and was reviewing article status and even I ran the SQL query of old forum in phpmyadmin but that’s not the problem. What more should do me?

Hi @leoto17,

Just to clarify, what’s in the status column for those rows? If your journal is public and I can see this behavior myself, could you send me a sample URL?

Regards,
Alec Smecher
Public Knowledge Project Team

Ok, this is the issue

aprendeenlinea.udea.edu.co/revistas/index.php/educacionfisicaydeporte/issue/view/32/showToc

The article is the second named "
POLÉMICA RELACIÓN ENTRE EL SUJETO INVESTIGADOR Y EL OBJETO INVESTIGADO", in status it has value 3.

Hi @leoto17,

I suspect the redirect that’s causing the problem is at approx. line 530 of pages/article/ArticleHandler.inc.php:

} else {
    $request->redirect(null, 'index');
}

The corresponding if statement is above…

// Make sure the reader has rights to view the article/issue.
if ($issue && $issue->getPublished() && $publishedArticle->getStatus() == STATUS_PUBLISHED) {

We can eliminate the two issue-related conditions, since other articles in the same issue are working without problems. That leaves the status issue.

Can you check (e.g. by changing the redirect call to fatalError("...") or similar) that this condition is in fact the one you’re running into?

Regards,
Alec Smecher
Public Knowledge Project Team

Yes, you have reason that is the if statement because I replace the redirect and it shows the fatalError. I try removing issue conditions but explorer says “this page is not working”, reviewing and doing debug I saw that $publishedArticle is null for article with problem then when if statement try do $publishedArticle->getStatus() == STATUS_PUBLISHED is null and here is the problem, why is null? What more I can do or what information can send you for review the problem cause?

Hi @leoto17,

Hmm, I still think the most likely cause is that the status column in the articles table is wrong for those rows. Is it possible that you were looking at the wrong data? The status should be 3 (which corresponds to the PHP STATUS_PUBLISHED constant).

Regards,
Alec Smecher
Public Knowledge Project Team

I understand you, beacause in some cases the status value in database is the problem and running the SQLScript all work, but in this case I don´t know, for you can see that I am saying true see the next picture of article with problems in database:

Hi @leoto17,

Have you made any modifications to the database or code? For example, adding a status column to the published_articles table or something similar?

Regards,
Alec Smecher
Public Knowledge Project Team

No any I don’t made modifications

Hi @leoto17,

Someone has definitely made modifications to that installation, if only the template and CSS files. I would suggest using the debug option in config.inc.php. When turned on, this will cause the installation to dump out all SQL queries that it executes. (All viewers will see this, so turn it on only for a moment!) You can then identify the SQL query that’s fetching article information for the issue and article you want; then you can try running that in your SQL client to see whether/why it’s returning null for status (if I understand the problem correctly).

Regards,
Alec Smecher
Public Knowledge Project Team

I am not sure what do you want that I do with debug, I attach a link that contains 2 files with debug info of article working and article with problems without login.

https://drive.google.com/drive/folders/0B-X08SDuVMHCbnlBR3JvaFg1WU0?usp=sharing

Hi @leoto17,

Do some of your articles have numeric custom identifiers? If so, that may be the problem – they will confuse OJS as OJS’s internal identifiers are numeric. Consider prefixing your custom identifiers with something so that they aren’t strictly numeric.

Regards,
Alec Smecher
Public Knowledge Project Team

You can see in next picture of the configuration, all custom identifiers are disabled

Hi @leoto17,

Had you already assigned numeric IDs to some of your articles, or have you never used this feature?

Regards,
Alec Smecher
Public Knowledge Project Team

Yes, I was enabled but is not neccesary then the admon disable it.

Hi @leoto17,

Even if you’ve disabled the field for new entries, existing numerical entries will still be used. I’d suggest either enabling the feature and changing existing custom identifiers so that they aren’t strictly numeric, or making similar changes directly in the database (which might be faster if there are lots of them).

Regards,
Alec Smecher
Public Knowledge Project Team

Could you tell me what I have that review or update or delete on database for repair the problem?

Hi @leoto17,

Look for entries in the article_settings table with setting_name set to pub-id::publisher-id. If these are numeric, I would suggest either adding a non-numeric prefix, or removing them.

Regards,
Alec Smecher
Public Knowledge Project Team