OJS /search/authors/ interface, dead code?


I started to track down an error message that kept on showing in my error log and noticed that there is a browse interface in https://site.fi/index/search/authors/ https://github.com/pkp/ojs/blob/master/pages/search/SearchHandler.inc.php#L188

However, when I click an author link, I get a white page. The link looks like this:

The related errors are:
[Fri Jan 19 23:02:28 2018] [error] [client] PHP Warning: assert(): Assertion failed in /var/www/www.site.fi/public_html/classes/issue/IssueAction.inc.php on line 37
[Fri Jan 19 23:02:28 2018] [error] [client] PHP Fatal error: Call to a member function getId() on null in /var/www/www.site.fi/public_html/classes/issue/IssueAction.inc.php on line 38

I did not even know that such interface exists and I do not think that there are any links leading to it. But some crawler seems to have found it and is trying to index it.

Before I dig any deeper, just wanted to know that is that partly dead code or should that work? @asmecher?

@asmecher Ok, so the problem is that the searchHandler code is going through the articles connected to the requested author and checking if the article requires subscription by checking the related issue. However, the journalId used there is coming from the request, meaning that if you do such browse in the site level, the context is not there => the error occurs.

I will do a pull request to fix this, but realize that it might be something that will be removed when the browse function is implemented in the system.

Hi @ajnyga,

The /search/authors interface is currently dead code – our plans are to replace any kind of built-in disambiguation, currently name-based (and thus inherently broken) with something that relies on a better third-party ID such as ORCiD. However, your PR is minimally invasive, so if it results in some use of that code while we ready some kind of replacement, so much the better – I’ve merged it.

Alec Smecher
Public Knowledge Project Team

Great, as I said I did not even know about it but apparently crawlers do. Maybe it is included in the OJS sitemap.

Hi @asmecher

A client of ours using OJS was receiving hits from a crawler and as each request took several minutes, a set of them arrived with slow periods and even unavailability when reaching the limit of PHP processes allowed simultaneously.

We blocked access via the web server and that was it. Warning here as it may affect more OJS users.

note: This journal came from OJS 2.4.x

1 Like

Hi @abadan,

This is also recently noted in a Github issue:

We’ll likely remove this feature once we’ve surveyed a few groups to make sure it won’t cause unexpected problems.

Alec Smecher
Public Knowledge Project Team