Skip to content

Bug: HyperlinkField.Href not working for Media using Insert Link #109

@JonMorgan-TF

Description

@JonMorgan-TF

bug

Using HyperlinkField.Href will give the wrong URL when the link field is a media item that has been added using 'Insert Link' (rather than 'Insert Media Link').

If I add using 'Insert Media Link', the raw value of the field is "<link linktype=\"media\" id=\"{E06C8962-B4D8-45E3-86D2-46B5D6FB60ED}\" />" - the linktype is "media" and the Href is "/-/media/song.mp3", which is fine.

If I add using 'Insert Link', the raw value of the field is "<link linktype=\"internal\" id=\"{E06C8962-B4D8-45E3-86D2-46B5D6FB60ED}\" />" - the linktype is "internal".

The Href is "/sitecore/media-library/song", so this is not valid (505).
However, the RenderedValue is correct and is "<a href=\"/-/media/song.mp3\">song</a>"

The Href should also be "/-/media/song.mp3"

I'm using Sitecore 9.3 and Synthesis 9.1.6

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions