core-geonetwork icon indicating copy to clipboard operation
core-geonetwork copied to clipboard

Social links in metadata page doesn't have the metadata page permalink

Open josegar74 opened this issue 5 months ago • 0 comments

Describe the bug In the metadata page, the links to social media doesn't contain the metadata page permalink, instead they contain a text undefined. For example, for the mail link:

mailto:?subject=Hydrological%20Basins%20in%20Africa%20(Sample%20record,%20please%20remove!)&body=undefined

To Reproduce Steps to reproduce the behavior:

  1. Load ISO19139 metadata samples
  2. Go to the metadata page of the Hydrological Basins in Africa (Sample record, please remove!) sample
  3. Scroll down to the social links and click the mail icon, it contains body=undefined instead of the metadata page permlink

Expected behavior The links should contain the metadata page permalink.

Additional context The problem is related to this code:

https://github.com/geonetwork/core-geonetwork/blob/36951d179d5b63b2e9134cf84987dc402acda86b/web-ui/src/main/resources/catalog/components/search/mdview/mdviewDirective.js#L591-L599

Debugging it, enters the first time, but newVal and oldVal are undefined and seems not executed later, so scope.socialMediaLink is undefined.


The code was changed in https://github.com/geonetwork/core-geonetwork/pull/7615 to use a watcher, to avoid another error, but it seems not being executed when the scope.md is updated.

Reverting the code, the JS error is there, but scope.socialMediaLink has the proper value.

josegar74 avatar Aug 29 '24 13:08 josegar74