Skip to main content
2 of 2
deleted 225 characters in body

Web 8.5 Tridion API special characters error with dynamic page links

When there are special characters in linkText attribute, Java application using 2013 Tridion renders the link text and link without issues. When the same pageLink is being rendered in 8.5 Tridion, the link in java application is not rendered. There are no errors in micro service logs.

xhtml fragement with special characters in linkText field

 <tridion:PageLink pageURI="tcm:10-1008-64" linkText="&lt;span &gt;&lt;/span&gt; &lt;span class=&quot;total&quot;&gt;test&lt;/span&gt;" textOnFail="true" anchor="" linkAttributes=" id=&#34;dashboardTestLink&#34; data-rackvalue=&#34;Link - test&#34;"/>

Java code snippet

 PageLink myPageLink = new PageLink(publicationId);
 String strURL = getLink(myPageLink, pageURI, linkText, linkAttributes, textOnFail, parameters);

Using postman, we get back response for a

Request

https://{contentmicroservice server name}client/v4/content.svc/GetPageLinkFunctionImport(PublicationId='10',TargetPageId='1008',Anchor='',LinkTagAttributes='',LinkText='&lt;span&gt;&lt;/span&gt;&lt;span class=&quot;total&quot;&gt;Test&lt;/span&gt;',ShowTextOnFail='true') 

Response

<content type="application/xml">
    <metadata:properties>
        <data:LinkUUID>22c10e4c-88c2-8aeff034c23f</data:LinkUUID>
        <data:Url>/test/Page.xhtml</data:Url>
        <data:Anchor></data:Anchor>
        <data:Parameters metadata:null="true"></data:Parameters>
        <data:TargetURI>tcm:10-1008-64</data:TargetURI>
  <data:Text>&amp;lt;span&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;span class=&amp;quot;total&amp;quot;&amp;gt;Test&amp;lt;/span&amp;gt;</data:Text>
        <data:Attributes></data:Attributes>
        <data:TextOnFail metadata:type="Boolean">true</data:TextOnFail>
    </metadata:properties>
</content>

Question Can this be an issue with the Tridion API used in java application, fetching data with encoded special characters?