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

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

Open josegar74 opened this issue 4 years ago • 1 comments

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)

  1. 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) <div data-gn-editor-helper="" data-ref="_47" data-type="textarea" data-related-element="" data-related-attr="" data-tooltip="iso19139|gmd:description|gmd:CI_OnlineResource|/gmd:MD_Metadata/gmd:contact/gmd:CI_ResponsibleParty/gmd:contactInfo/gmd:CI_Contact/gmd:onlineResource/gmd:CI_OnlineResource/gmd:description" data-multilingual-field="true" class="ng-scope ng-isolate-scope">

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).

josegar74 avatar Mar 18 '20 11:03 josegar74

  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)

It would be hard to maintain I think and you have to be sure that a suggestion is available in all language files. It probably make more sense to use a thesaurus in such situation ?

2. Does it make sense, the current suggestion list for gmd:description in online resources with projections

It does not make any sense. Probably an error ? https://github.com/geonetwork/core-geonetwork/pull/3454/files#diff-9edb196db9b6857e1f3e578db9328026R1052-R1055

fxprunayre avatar Mar 19 '20 07:03 fxprunayre