Skip to content

[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
geonetwork:4.2.xfrom
GeoCat:backport-9461-to-4.2.x
Open

[Backport 4.2.x] Metadata editor / Online resources / Fix mimeTypeStrategy parameter when adding a new online resource#9464
josegar74 wants to merge 1 commit into
geonetwork:4.2.xfrom
GeoCat:backport-9461-to-4.2.x

Conversation

@josegar74

Copy link
Copy Markdown
Member

Backport #9461

…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>
@josegar74 josegar74 added this to the 4.2.18 milestone Aug 7, 2026
@josegar74
josegar74 requested a review from juanluisrp August 7, 2026 06:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant