4Science / dspace-angular

Angular UI for DSpace and DSpace-CRIS. In the dspace-cris-7 branch you can find the extension to support DSpace-CRIS
BSD 3-Clause "New" or "Revised" License
14 stars 28 forks source link

404 requests to path /undefined (affects DS CRIS 2023.01) #40

Open saschaszott opened 1 year ago

saschaszott commented 1 year ago

Describe the bug

We see a lot of 404 GET request to http://ds7crishost.tld/undefined in our DS CRIS 2023.01 test instance. The requests can be found in the browser console. They occur when we reload the “home” page (/) as well as when we open the Research output page (/explore/researchoutputs).

The same effect can be found at the 4Science CRIS demo app (https://dspacecris7.4science.cloud/explore/researchoutputs).

Steps to reproduce

  1. open dev console in your favourite browser
  2. open URL https://dspacecris7.4science.cloud/explore/researchoutputs
  3. a request to https://dspacecris7.4science.cloud/undefined occurs in the console (404) 👉 see screenshots

image

image

Expected behavior

The request to /undefined does not occur.

santilococo commented 1 year ago

This is related to this issue in the backend.

As you mentioned, it occurs on the home page and in the research outputs page. It is specifically related with the recent-additions and the most-viewed lists.

To temporarily address this issue, you can modify the source code so that it doesn't display the thumbnails for the recent-additions and most-viewed lists. By implementing this temporary fix, you will observe that there are no more requests to ${DSPACE_URL}/undefined.

saschaszott commented 1 year ago

@santilococo , thank you for analyzing this issue. Do you know exactly which code line(s) generate the URL path /undefined?

santilococo commented 1 year ago

Yes. I can send you a patch:

0001-Implement-temporary-solution-for-thumbnail-issue.patch

As you can see, the related file is located at src/app/shared/browse-most-elements/browse-most-elements.component.html. It is using a ds-listable-object-component-loader, and I suspect the issue lies with the searchResults input object. It seems that the data is being loaded incorrectly, possibly due to the _links of the bitstream or some other factor. I attempted to fix it but was unsuccessful.

Do you have any suggestions or ideas on how to address this issue?

saschaszott commented 1 year ago

Thanks for the investigation. To skip thumbnails the DSpace configuration variable browseBy.showThumbnails can be set to false in config.yml.

There were some changes in listable-object-component-loader.component.ts in May 2023 with regard to showThumbnails by @atarix83 .