New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HyperlinkField doesn't handle internal links with query strings #7

Closed
Gobiner opened this Issue Oct 2, 2014 · 2 comments

Comments

Projects
None yet
2 participants
@Gobiner
Copy link

Gobiner commented Oct 2, 2014

I've got a General Link field whose value is "/Document-Library/Search-Results?q=Something". The inner field has type="internal" but I guess because of the query string, the target ID is empty. This causes FieldUtility.GetGeneralLinkHref to incorrectly return the empty string, which causes the HyperlinkField's Href and HasValue properties to be incorrect.

((IExternalDocumentReferenceEntity)file).DocumentLink
{}
    [Synthesis.FieldTypes.HyperlinkField]: {}
    CssClass: ""
    Href: ""
    Target: "_blank"
    TargetItem: null
    Text: ""
    Title: ""
((IExternalDocumentReferenceEntity)file).DocumentLink.HasValue
false
((IExternalDocumentReferenceEntity)file).DocumentLink.RenderedValue
""
((IExternalDocumentReferenceEntity)file).DocumentLink.ToLinkField()
{Sitecore.Data.Fields.LinkField}
    base {Sitecore.Data.Fields.XmlField}: {Sitecore.Data.Fields.LinkField}
    Anchor: ""
    Class: ""
    InternalPath: "/sitecore/content/Document-Library/Search-Results?q=MSDS"
    IsInternal: true
    IsMediaLink: false
    LinkType: "internal"
    MediaPath: ""
    QueryString: "q=MSDS"
    Target: "_blank"
    TargetID: {00000000-0000-0000-0000-000000000000}
    TargetItem: null
    Text: ""
    Title: ""
    Url: "/Document-Library/Search-Results?q=MSDS"
@kamsar

This comment has been minimized.

Copy link
Collaborator

kamsar commented Nov 16, 2014

The PR has been merged, and this will be in the next Synthesis release

@kamsar kamsar closed this Nov 16, 2014

@kamsar

This comment has been minimized.

Copy link
Collaborator

kamsar commented Nov 16, 2014

Synthesis 7.2.1 includes this fix, on nuget, etc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment