[OJS 3.2.0.3] Error on Submission Page

Hello @Vitaliy,
I have upgraded both my 3.2.0-1 Installations to 3.2.0-3 and the problem persists.

The error log now shows the following error three times:
[Fri Jun 05 15:32:46.200626 2020] [php7:notice] [pid 3511] [client 132.199.243.39:35912] ojs2: 404 Not Found, referer: http…

In the other installation the Errorlog is inconclusive.

Does the error from the web feed plugin persist?

Can you describe when this error appears? What’s the full message?

Hello,

the WebFeedError is no longer there, it’s replaced by the one I mentioned.

The Error appears when opening the submissions page. The Popup opens three times, like mentioned above. The log coincides with the error on one journal, on the other no error log entry is made but the error appears to be the same on the front end.

The full error log entry is:
[Fri Jun 05 17:03:34.929330 2020] [php7:notice] [pid 3725] [client 132.199.243.35:55112] ojs2: 404 Not Found, referer: http://journalurl/submissions
[Fri Jun 05 17:03:34.972423 2020] [php7:notice] [pid 3724] [client 132.199.243.35:55108] ojs2: 404 Not Found, referer: http://journalurl/submissions
[Fri Jun 05 17:03:34.982762 2020] [php7:notice] [pid 3729] [client 132.199.243.35:55110] ojs2: 404 Not Found, referer: http://journalurl/submissions

I do have a .htaccess configured for both journals, that cuts out the “index.php/journalname” part of the URL:

RewriteEngine On
RewriteBase /

# Rewrite URL to look cleaner
RewriteCond %{SERVER_NAME} ^www.journalurl
RewriteCond %{REQUEST_URI} !/journal/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/journal/$1 [L]

Looks like a controller for a submissions page isn’t found. Yes, it’s likely because of URL rewrite. Did you check through the forum needed configurations in ojs config and apache requests redirecting/remapping? e.g.: How to remove index.php in ojs 3.0.2.0.

Hello Vitaliy,

I seem to have found the problem, but I have no Idea on how to fix it.

the .htaccess is set to cut “index.php/journal/” from the URL. I do this, because I don’t want users to see the “/journal/” part in the URL and because I am upgrading older journals, that have a lot of DOI links to the URL without “/journal/” from older OJS 2 times.

If I cut “index.php” only from the URL, the submissions page works fine. Every other pages do too, but my DOI links are broken.
If I cut “index.php/journal/” from the URL, the submissions page doesn’t work. Every other page does.

Is there maybe something in the submissions page, that calls explicitely to the “journal” part in the URL?

Thanks and Greetings.

Yes, as far as I remember in many parts of the code Journal (or Context) is retrieved from a request. I don’t think that it would be possible to cut the journal from the URL without code modification. First, I would check if this method works properly: https://github.com/pkp/pkp-lib/blob/c512bf148e43b8beafed90879200aa9b67807d93/classes/core/PKPRouter.inc.php#L226
(if it return the context).

Also it’s possible to make journal invisible to the public from the dashboard -> administration -> hosted journals -> edit button

Hello Vitaliy
I don’t quite know how to test if getContext is working.

From the browser debugging tools, it seems that a.pkp.controllers.modal.ModalHandler.prototype.modalOpen is throwing errors:
grafik

grafik

Hello,

I am still having problems with this error. Do you have any other ideas as to what may cause this?

Thanks!

Hi @KBodarwe,

As I wrote before, I’m not sure if PKPRouter::getContext will work if URL is missing the context part. Take a look at developer’s docs: https://docs.pkp.sfu.ca/dev/documentation/en/architecture-routes, context part points to the journal in OJS. Let’s assume that context is missing, how would Router determine the current context?

You can try to debug, not sure what debugging approach are you using, but the result can be simply written in the logs, e.g., error_log(print_r($yourVariableHere, true)).

Referred JS error just indicates that the element there should be in the DOM is missing.

1 Like

Hi,
I am also waiting for a solution for the error when the context path is removed via mod_rewrite.
There is an issue on Github at this link and I am following it. I removed my customization on journal path and updated all DOIs via DOI plugin.
API calls fail if context path is obscured by RESTful URL configuration
Regards.,

Hi, we are seeing the same issue as well when opening the Submissions page (a popup error appears three times) with OJS 3.2.0.3. The page seems to load the content correctly after the errors are dismissed. The error does not appear with previous versions of OJS e.g. 3.1.2.x.

It appears that it’s to do with the URL rewrite that we have in place to remove “index.php/journal” so that it’s not visible to users.

If we don’t do the rewrites i.e. URL becomes “https://server/journal/index.php/journal/submissions”, the errors don’t pop up when accessing the Submissions page.

1 Like

I have tried to insert a Redirect into my .htaccess that redirects the submissions page to show the correct URL.
i.e.:

RewriteEngine On
RewriteBase /

RewriteRule ^submissions(.*)$ index.php/journal/submissions$1 [R,L]
RewriteRule ^stats(.*)$ index.php/journal/stats$1 [R,L]

RewriteCond %{SERVER_NAME} ^www.server.de
RewriteCond %{REQUEST_URI} !/journal/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/journal/$1 [L]

Now the correct URL gets shown when accessing the submissions page, but the error still persists. Any Idea why that didn’t fix it?
Thanks!

Update: I tried this approach:

RewriteEngine On
RewriteBase /

# Bugfix for OJS 3.2.0-3: submissions API doesnt work with shortened URLs
RewriteRule ^api/v1(.*)$ index.php/journal/api/v1$1 [R,L]

# Rewrite URL to look cleaner
RewriteCond %{SERVER_NAME} ^www.server.com
RewriteCond %{REQUEST_URI} !/journal/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/journal/$1 [L]

and it works.

The re-routing of the API seems to work.

1 Like

This is brilliant KBodarwe. I’ve tried adding the line…

RewriteRule ^api/v1(.*)$ index.php/journal/api/v1$1 [R,L]

…and it’s working perfectly with our existing URL rewrites for OJS 3.2.0.3 based journals.

Thanks for sharing!

Some more information on this can be found in this GitHub issue:

Hi @KBodarwe
Thank you very much for your contribution. I have tested your solution on my test domain, and can confirm that it works very well. I applied it to my live site and will update all DOI records now.
Best regards,

Unfortunately, I was happy a little early. Now, when I try do update the DOI records using Crossref plugin, I get Unrecognized DAO PublishedArticleDAO! on a white page .There are some other people having the same error;


So, I will go on watching the forum.
Regards,

Hi @KBodarwe,
How many journals exist on your OJS 3 installation?
Besides error in Crossref plugin, the ordinary users (authors or reviewers etc) also get such an error when they are logged in, or when clicked on submissions each time.(screenshot)
This typically occurs when there are multiple journals on a domain, and occur in the second, and third journals. I think, the path of the first journal is added to all other journals too. For example the path of the first journal atb exist in the second journal api links (citymedicaljournal.com).
For ex; such a configuration gives the error

RewriteEngine On
RewriteBase /

# Bugfix for OJS 3.2.0-3: submissions API doesnt work with shortened URLs
RewriteRule ^api/v1(.*)$ index.php/atb/api/v1$1 [R,L]

RewriteCond %{SERVER_NAME} ^www.adlitipbulteni.com
RewriteCond %{REQUEST_URI} !/atb/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/atb/$1 [L]

RewriteCond %{SERVER_NAME} ^www.citymedicaljournal.com
RewriteCond %{REQUEST_URI} !/cmj/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/cmj/$1 [L]

The github issue seems have been closed, but I hope it will be reopened for a better fix.
Dou you have any suggestions?
Best regards,

Hello @drugurkocak,
all my installations are single-journal, for various reasons. So I can’t help you with that. The API probably has to be redirected seperately for both journal api (add the RewriteCond with SERVER_NAME to the api rewrite), but that’s just speculation on my side.

So yes I should clarify, that my solution only works for single journal installations.

1 Like

Another update.
I have found out that the upload of files within the page is hindered by this.
I have since changed the .htaccess to:

RewriteEngine On
RewriteBase /

# Bugfix for OJS 3.2.0-3: submissions API doesnt work with shortened URLs
RewriteRule ^api/v1(.*)$ index.php/journal/api/v1$1 [L,R=307]

# Rewrite URL to look cleaner
RewriteCond %{SERVER_NAME} ^www.server.com
RewriteCond %{REQUEST_URI} !/journal/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/journal/$1 [L]

which seems to fix the problem regarding POST data.

2 Likes