geonetwork / geonetwork/core-geonetwork

Editor - Issues with multilingual fields with suggestion values configured in labels.xml

Open
#4,534 1 comment 0 reactions 0 assignees View on GitHub
stale
Dominant language
Java
Stars
521
Forks
514
Avg merge
6d 13h
Merged PRs (30d)
19

Description

Test:

1) Create a new iso19139 multilingual metadata

2) Change to advanced view and add to a metadata contact an online resource (`Website` field)

3) Description field for the onine resource is displayed as multilingual with empty suggestions list, `labels.xml` has a list of values (English language), but seem not pickup in multilingual fields:

https://github.com/geonetwork/core-geonetwork/blob/eccf6696fc8797de7733885d1ad439182334c5b0/schemas/iso19139/src/main/plugin/iso19139/loc/eng/labels.xml#L1052-L1086)

4) Enable tooltips and save the metadata, the following JS error is displayed:

```
angular.js?v=600a7b03437e8ab5031c2952c212aad1371c74d1:13294 TypeError: Cannot read property 'value' of undefined
at link (https://vanilla.geocat.net/geonetwork/catalog/components/edit/editorhelper/EditorHelperDirective.js:121:36)
at https://vanilla.geocat.net/geonetwork/catalog/lib/angular/angular.js?v=600a7b03437e8ab5031c2952c212aad1371c74d1:9519:44
at invokeLinkFn (https://vanilla.geocat.net/geonetwork/catalog/lib/angular/angular.js?v=600a7b03437e8ab5031c2952c212aad1371c74d1:9525:9)
at nodeLinkFn (https://vanilla.geocat.net/geonetwork/catalog/lib/angular/angular.js?v=600a7b03437e8ab5031c2952c212aad1371c74d1:8932:11)
at https://vanilla.geocat.net/geonetwork/catalog/lib/angular/angular.js?v=600a7b03437e8ab5031c2952c212aad1371c74d1:9264:13
at processQueue (https://vanilla.geocat.net/geonetwork/catalog/lib/angular/angular.js?v=600a7b03437e8ab5031c2952c212aad1371c74d1:15627:28)
at https://vanilla.geocat.net/geonetwork/catalog/lib/angular/angular.js?v=600a7b03437e8ab5031c2952c212aad1371c74d1:15643:27
at Scope.$eval (https://vanilla.geocat.net/geonetwork/catalog/lib/angular/angular.js?v=600a7b03437e8ab5031c2952c212aad1371c74d1:16895:28)
at Scope.$digest (https://vanilla.geocat.net/geonetwork/catalog/lib/angular/angular.js?v=600a7b03437e8ab5031c2952c212aad1371c74d1:16711:31)
at Scope.$apply (https://vanilla.geocat.net/geonetwork/catalog/lib/angular/angular.js?v=600a7b03437e8ab5031c2952c212aad1371c74d1:17003:24)


```

Seem the identifier assigned to multilingual fields with suggestions doesn't match with the identifier expected by the tooltip directive, causing the `field` being empty:

https://github.com/geonetwork/core-geonetwork/blob/eccf6696fc8797de7733885d1ad439182334c5b0/web-ui/src/main/resources/catalog/components/edit/editorhelper/EditorHelperDirective.js#L118-L121

@fxprunayre:

1) Does it make sense the suggestions for multilingual fields (if so we should support that in the `labels.xml`, not sure if very optimal as will have to add all translations in every `labels.xml` file probably)

2) Does it make sense, the current suggestion list for `gmd:description` in online resources with projections that seem quite focus on INSPIRE supported projections? (other `labels.xml` for other languages doesn't have this configuration).

Contributor guide

Open the contributing guide

Research direction

Reproduce the multilingual ISO 19139 metadata steps with the online resource Website field, then inspect labels.xml around the gmd:description suggestions and web-ui/src/main/resources/catalog/components/edit/editorhelper/EditorHelperDirective.js around lines 118-121. Determine how multilingual field identifiers and tooltip lookup interact. Done means suggestions behave consistently and enabling tooltips and saving no longer produces the reported JavaScript error.

Written by the indexing model from the issue text.

Assessment

Tech stack
angularjs, javascript, xml
Domain
frontend, localization
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.