OJS 3.1.0.1. /search/authors/ interface, dead code?

Hi,

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:
https://site.fi/index/search/authors/view?firstName=John&middleName=&lastName=Doe&affiliation=&country=

The related errors are:
[Fri Jan 19 23:02:28 2018] [error] [client 46.229.168.77] 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 46.229.168.77] 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.

Regards,
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 3.2.1.4 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.

Regards,
Alec Smecher
Public Knowledge Project Team

2 Likes