Fix issues with metadata api view redirect#9180
Draft
tylerjmchugh wants to merge 1 commit intogeonetwork:mainfrom
Draft
Fix issues with metadata api view redirect#9180tylerjmchugh wants to merge 1 commit intogeonetwork:mainfrom
tylerjmchugh wants to merge 1 commit intogeonetwork:mainfrom
Conversation
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.
There are a couple of issues with the metadata API view redirect introduced in #8966.
1. Language not preserved
The redirect URL does not include the language, so the link always resolves to the default language.
This means multilingual emails would have multiple links pointing to the same page with the default language. It would be better to have each link point to its respective langauge.
This PR adds support for a language parameter and uses it in the redirect URL. If the language code is invalid, it falls back to the default language.
2. Formatter name in permalink
The formatter name is currently embedded in the permalink. This creates a fragile link — if the formatter is renamed or removed, existing links will break.
This PR replaces the formatter name in the URL with a boolean redirect flag. The API then resolves the current record link formatter from configuration. This ensures links remain valid even if the formatter changes.
This PR contains API changes
Checklist
mainbranch, backports managed with labelREADME.mdfilespom.xmldependency management. Update build documentation with intended library use and library tutorials or documentation