I have discovered why nothing is in the server logs: the error is occuring in my browser as it executes javascript. Look for “api_submissions_unknownError” in js/build.js; there is code there for issuing this message.
To prove this theory, I edited js/build.js by changing the variable $.pkp.locale.api_submissions_unknownError into the literal string “BLAHBLAH”. Sure enough, the popup error message now says “BLAHBLAH”.
Looking again at that point in build.js, the code there is doing something related to the modalHandler — recall from above that I see 2 or 3 javascript errors in js/modalHandler.js at exactly the same time as the ##api.submissions.unknownError## message pops up.
I strongly suspect that the way to make the error popup disappear is to fix the errors in modalHandler.js.
@bdm, api_submissions_unknownError is the error message that the JavaScript code will display when it encounters an error it doesn’t know how to handle. This usually indicates that an ajax request to the server has failed. You’re correct that the error message is triggered in the JavaScipt, but it usually indicates a problem on the server.
@NateWr I spent 7-8 minutes clicking between the menus in the journal manager’s view (i.e Submissions, Issues, Settings, Users&Roles, Tools and Administration). The error pop appeared many times and the common situation between all of them was being in the Submissions area then leaving, either to one of the other admin sections, Settings.Website, or even to “View Site” or logout.
Contrary to what I thought before, it is not specific to Settings.Journal. Moving from Submissions to anywhere triggers it. Even being in Submissions and clicking again on Submissions triggers the error.
I could not trigger the error on leaving one of the other admin sections, for example leaving from Administration. I only managed it by leaving Submissions.
Before doing this, I set PHP’s reporting level to “everything” and restarted the web server (which began a new error log). After finishing, I made a copy of the error log. You can have a copy if you like, but I can tell you it has only:
The web server startup message.
One ssl error triggered by someone in another country.
About 250 lines similar to “[Sat Apr 14 13:05:51.943824 2018] [php7:warn] [pid 21056] [client MYIPNUMBER:54400] PHP Warning: Declaration of PKPUsageEventPlugin::getEnabled() should be compatible with LazyLoadPlugin::getEnabled($contextId = NULL) in /usr/local/share/ojs/lib/pkp/plugins/generic/usageEvent/PKPUsageEventPlugin.inc.php on line 0, referer: https://MYJOURNALURL/…”
If you can think of some code that gets executed at the moment of leaving the Submissions area, I’m happy to insert some debugging code into it. At the moment I don’t even know where to look.
Unfortunately, I’m not familiar with any code that would be triggered on leaving a page. If you can send me by private message the error log I’ll take a look and see if I can spot anything unusual, but I don’t have many ideas at this point…
When restful_urls = On the index.php should be removed from all of your requests. If it’s not, you’re probably missing the .htaccess configuration you need to run with restful_urls = On.
@Gecuimar, I notice that http://localhost//journal/ includes a double slash (//). Maybe that’s the issue? Can you try removing any ending slash from your base_url to see if that helps?
I’ve checked that the restfulUrlsEnabled condition in function getApiUrl of file js/build.js is a bit confusing.
The condition removes the index.php page from api url http://localhost//journal/api/v1/_submissions and the ajax request produces the error message ##api.submissions.unknownError##.
The solution is to maintain the “index.php” still when restfulUrls are enabled.
getApiUrl: function(t) {
var e, n = “index.php”; // $.pkp.app.restfulUrlsEnabled ? “” : “index.php”;
return e = $.pkp.app.contextPath ? “/” + $.pkp.app.contextPath + $.pkp.app.apiBasePath : $.pkp.app.apiBasePath, $.pkp.app.pathInfoEnabled ? $.pkp.app.baseUrl + “/” + n + e + “/” + t : $.pkp.app.contextPath ? $.pkp.app.baseUrl + “/” + n + “?journal=” + encodeURIComponent($.pkp.app.contextPath) + “&endpoint=” + e + “/” + t : $.pkp.app.baseUrl + “/” + n + “?endpoint=” + e + “/” + t
}
The removal of the index.php with restful_urls enabled is intentional; see the config.inc.php note on the restful_urls setting and associated entry in docs/FAQ.
Regards,
Alec Smecher
Public Knowledge Project Team
I’m sure of this, but when using mod_rewrite to work with a single journal without contextPath, this condition causes the error message ## api.submissions.unknownError ##.
Hmm, I don’t know whether directing both base_url[index] and base_url[journal] to the same place will cause problems.
However, I suspect the problem is that the mod_rewrite rules that you’re using to remove bothindex.php and the journal path aren’t behaving properly. I’d suggest backing off to just removing the index.php, making sure everything works, then considering the removal of the journal path second.
Regards,
Alec Smecher
Public Knowledge Project Team
I tried removing the double “/” and that does not work!
This is the link that OJS tries to access: https://domain.sub.se//jounralX/api/v1/_submissions?status=1&searchPhrase=&count=20&offset=0&_=1550044118374
→ causes 500 Internal Server Error
This: https://domain.sub.se/jounralX/api/v1/_submissions?status=1&searchPhrase=&count=20&offset=0&_=1550044118374
→ causes 500 Internal Server Error
However only: https://domain.sub.se/index.php/jounralX/api/v1/_submissions?status=1&searchPhrase=&count=20&offset=0&_=1550044118374
→ causes 200 OK!