dspace-angular icon indicating copy to clipboard operation
dspace-angular copied to clipboard

Hitting browse by author from by issue date gets server error

Open cwilper opened this issue 5 years ago • 3 comments

Whether on the homepage, or scoped to a collection, if you first browse by issue date, then immediately select to browse by author, the list shows, but the javascript console displays an error indicating that a bad request was made.

When the error occurs, the request made is GETting the discover/browses/author/items endpoint. The text of the error in the stack trace is "The requested browse doesn't provide direct access to items you must specify a filter". It's coming from BrowseItemLinkRepository.

cwilper avatar Feb 07 '20 15:02 cwilper

I encountered this again today on pre-7.3. It appears that our UI is sending two requests when hitting Browse by Author.

  1. /server/api/discover/browses/author/items?scope=[uuid] -> This results in a 500 Exception on the backend, with this error:
    java.lang.IllegalStateException: The requested browse doesn't provide direct access to items you must specify a filter
    at org.dspace.app.rest.repository.BrowseItemLinkRepository.listBrowseItems(BrowseItemLinkRepository.java:82)
    
  2. Immediately after that, the correct request is performed: /server/api/discover/browses/author/entries?scope=[uuid]. This request returns results which are displayed on the page.

From the user perspective, the browse by options appear to work. However, they result in this 500 exception appearing in the DSpace logs and in the DevTools of your browser

While the 500 exception seems harmless, we should fix the browse UI code to only make the proper request.

Moving this to 7.4 and flagging as high priority.

tdonohue avatar Jun 21 '22 21:06 tdonohue

I am seeing this exception as well while testing with DSpace 7.3. I have ORCID Authority configured for dc.contributor.author but I get no results at all when going to Browse By Author. Browse By Issue Date, Title, and Subject all work fine.

Interestingly, a direct backend server query on /server/api/discover/browses/author/entries shows author entries. This is both with the HAL Browser and also using Postman for testing. And yet, for some reason, the angular UI does not show any results with Browse By Author.

To be clear, the author browse index is configured as:

webui.browse.index.2 = author:metadataAuthority:dc.contributor.author:authority

uofmsean avatar Sep 15 '22 21:09 uofmsean

Looking at the code and it appears that BrowseByDataType doesn't yet support the "authority" dataType, which is why Browse By Author was showing nothing. Switching back to:

webui.browse.index.2 = author:metadata:dc.contributor.*\,dc.creator:text

and now I see results. Unfortunately, I don't know how this affects the ORCID Authority feature which says to use:

webui.browse.index.2 = author:metadataAuthority:dc.contributor.author:authority

uofmsean avatar Sep 16 '22 21:09 uofmsean