geonetwork / core-geonetwork

GeoNetwork is a catalog application to manage spatially referenced resources. It provides powerful metadata editing and search functions as well as an interactive web map viewer. It is currently used in numerous Spatial Data Infrastructure initiatives across the world.
http://geonetwork-opensource.org/
GNU General Public License v2.0
428 stars 489 forks source link

Change the harvester logo in the harvester page doesn't update the harvester logo image in the metadata detail page #2752

Open josegar74 opened 6 years ago

josegar74 commented 6 years ago

Test:

1) Create a harvester and assign a logo 2) Execute the harvester 3) Check the metadata detail page of a harvested record --> Provided by panel displays the logo 4) Change the harvester logo and save the harvester 5) Remove metadata from harvester and reharvest (this should not be required, but just in case) 3) Check the metadata detail page of a harvested record --> Provided by panel displays the old logo instead of the new one


The problem is this line in the code:

https://github.com/geonetwork/core-geonetwork/blob/3.4.x/core/src/main/java/org/fao/geonet/resources/Resources.java#L449

When updating the logo causes this exception and the logo is not replaced:

java.nio.file.FileAlreadyExistsException:/PATH/WEB-INF/data/data/
resources/images/logos/9b6f6a49-d32e-4a4f-8b4e-8268b8434d12.png
pvgenuchten commented 6 years ago

So you're replacing the logo by a file with the same name? It seems valid to throw an error, but apparently the server error is not propagated to the user. Best would be to throw an error and let the user decide if (s)he wants to overwrite the existing file (&force=true). Or store the file with a unique name.

ghost commented 4 years ago

Hi,

should this work in 3.10.3?

Thanks.

ghost commented 4 years ago

Hi,

I did small test in 3.10.3.

I am not sure what happens after one sets/updates logo for harvesters or/and groups.

After updating the logo for harvesters nodes in "Harvesting" section following should happen:

  1. icon in metadata records in search results should be new or updated harvester logo image grafik

  2. Provided by icon should be also new or updated harvester logo image grafik

Is that correct?

What happens when group and harvester logo are both set? What happens when only group logo is set?

I didn't find any documentation on this in order to check it properly.

juanluisrp commented 4 years ago

Maybe you need to re-index to view the canges

ghost commented 4 years ago

In Geonetwork Vanilla changes can be seen immediatly after page is refreshed.

But I will try to reindex and see what happens.

Thanks!

ghost commented 4 years ago

Re-index solved the problem. Logos are shown like described in https://github.com/geonetwork/core-geonetwork/issues/2752#issuecomment-659374634.

Thanks a lot @juanluisrp !