IBM Rational Change: Issues with single and double quotes in RTF fields

Technote (troubleshooting)

Problem(Abstract)

Change 5.2.0.5 changes the way single and double-quotes are interpreted in RTF fields (such as "WSLET") at the time Javascript is produced. This can cause issues in your customized code when your browser interprets the produced code.

Symptom

Try to use a variable as below with an attribute MY_ATTRIBUTE of type CCM_EXTENDED_TEXT:

Then, give it a value as below (please note the presence of two "single quote" characters in the sentence): === It's an example of how single quotes' interpretation causes trouble. ===

The code produced can eventually cause issues on the final page when it's rendered in a browser (errors on the page, incorrect display, etcetera.)

Cause

This has been identified as a product defect under APAR PM68408

The root cause is a combination of both :

a change in the product's behavior...

...and...

a confusion in the attributes types in your custom code.

In Change 5.2.0.4-06, the example above would eventually produce a code similar to this, in HTML: var currentSituation = " &lt;div&gt; &lt;div style=&quot;mso-line-spacing:&amp;quot;108 0.....

In Change 5.2.0.5, it will produce a code like this : var currentSituation = "<div> <div style=""><span style="font-family:...

Please observe how
&quot; is now directly replaced by
quote characters. This is a new behavior in Rational Change. Because of this, the single quotes or double-quotes present in the code can now "confuse" the browser when there is an odd number of them.

HOWEVER, this bad translation of the quote characters happens more specifically when there is a confusion in your custom code between:
- the data type used for the attribute on the one hand,
- the data type used in the instruction to get the value of the attribute, on the other hand.

Diagnosing the problem

Simply use an instruction similar to the one below, and observe the code produced in the final HTML page (compare it with the examples above, from the "Cause" section of this Technote) 'var currentSituation = ""; '

Resolving the problem

Upgrade to the release of Change that includes APAR PM68408.

In the mean time, make sure you're consistent in your attributes types.

In the example described in the "Cause" section of this Technote, you must replace "CCM_STRING" with "CCM_EXTENDED_TEXT", because the attribute MY_ATTRIBUTE is indeed of type CCM_EXTENDED_TEXT :