[Backport 4.2.x] Metadata editor / Online resources / Fix mimeTypeStrategy parameter when adding a new online resource - #9464
Open
josegar74 wants to merge 1 commit into
Open
Conversation
…hen adding a new online resource (geonetwork#9461) * Metadata editor / Online resources / Fix mimeTypeStrategy parameter when adding a new online resource * Metadata editor / Online resources / Read mimeTypeStrategy from the panel configuration The mimeTypeStrategy assignment in openDialog is overwritten before the resource is submitted, so the parameter reaches the onlinesrc-add process empty and the process falls back to writing the bare protocol, dropping the MIME type. Two things reset it. The params.linkType watcher rebuilds config.multilingualFields without the isMdMultilingual guard that openDialog uses, so mimeTypeStrategy is treated as a multilingual field even on a monolingual record. resetProtocol() then blanks every multilingual field except name and desc on each protocol change, which already happens once when the dialog applies the configured default protocol. On a multilingual record the value additionally becomes a per-language object and is submitted as "eng#|fre#". mimeTypeStrategy is a configuration option rather than a user input, so keeping it in scope.params exposes it to form handling it should not be subject to. Read it from the link type configuration when building the process parameters instead, and drop the two hardcoded assignments. This also lets a catalogue select the "protocol" strategy, which the hardcoded value made unreachable. Restore the isMdMultilingual guard in the watcher as well, so that it agrees with openDialog for any other non-multilingual option field. * Documentation / Associated resources panel / Document mimeTypeStrategy The mimeTypeStrategy option of the associated resources panel configuration was not described anywhere in the manual, so the two encodings it selects were only discoverable by reading onlinesrc-add.xsl. Describe both values with the XML they produce, note that the option takes only a value because it is passed to the process rather than shown to the user, and state the fallbacks when the value or the whole entry is omitted. --------- Co-authored-by: Juan Luis Rodriguez Ponce <juanluisrp@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport #9461