Textareas not displaying existing content when my theme is enabled

Found the problem. My theme was actively omitting the content of textarea.

I had a xsl rule used to inject an additional class into my textareas, but it was not putting back the content of the textarea.
(BTW.. if you use the rules below in Diazo they must never be found in nested tags)

 <xsl:template match="//textarea">                                                
     <xsl:copy>
        <xsl:copy-of select="attribute::*[not(name()='class')]" />                 
        <xsl:attribute name="class"><xsl:value-of select="@class" />               
            <xsl:choose><xsl:when test="@class[contains(., 'blurrable')]">         
             blurrable
            </xsl:when>                                                            
            </xsl:choose>                                                          
            <xsl:choose><xsl:when test="@class[contains(., 'firstToFocus')]">      
            firstFocus                                                             
            </xsl:when>
            </xsl:choose>
                gl-textarea
        </xsl:attribute>                                                
    </xsl:copy>
</xsl:template>

The solution was to add the following line:

 <xsl:value-of select="." />   

Now the rule looks like this and everything works as expected.

 <xsl:template match="//textarea">                                                
     <xsl:copy>
        <xsl:copy-of select="attribute::*[not(name()='class')]" />                 
        <xsl:attribute name="class"><xsl:value-of select="@class" />               
            <xsl:choose><xsl:when test="@class[contains(., 'blurrable')]">         
             blurrable
            </xsl:when>                                                            
            </xsl:choose>                                                          
            <xsl:choose><xsl:when test="@class[contains(., 'firstToFocus')]">      
            firstFocus                                                             
            </xsl:when>
            </xsl:choose>
                gl-textarea
        </xsl:attribute>                                                           
        <xsl:value-of select="." />                                                
    </xsl:copy>
</xsl:template>
1 Like