Changeset 32836

Show
Ignore:
Timestamp:
01.03.2019 21:43:18 (8 months ago)
Author:
ak19
Message:

Fixing annoying browser js error when classifier hfile attribute present but empty, then the full path constructed to the hfile only goes as far as up to the etc folder and a GET request on that etc folder fails. Now we don't bother doing a GET on any hfile that has an empty string value.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/web/interfaces/default/transform/pages/document.xsl

    r32832 r32836  
    342342                </xsl:text> 
    343343                <!-- download and process hierarchy files --> 
    344                                 <xsl:text disable-output-escaping="yes">$(document).ready(function(){</xsl:text> 
    345                                 <xsl:for-each select="//classifier[@hfile]"> 
    346                                         <xsl:text disable-output-escaping="yes">downloadAndProcessHierarchyFile('</xsl:text> 
    347                                         <xsl:text>sites/localsite/collect/</xsl:text><xsl:value-of select="$collName"/><xsl:text>/etc/</xsl:text><xsl:value-of select="@hfile"/> 
    348                                         <xsl:text disable-output-escaping="yes">','</xsl:text><xsl:value-of select="@metadata"/><xsl:text disable-output-escaping="yes">');</xsl:text> 
    349                                 </xsl:for-each> 
     344                                <xsl:text disable-output-escaping="yes">$(document).ready(function(){</xsl:text>                                 
     345                                    <xsl:for-each select="//classifier[@hfile]"> 
     346                                        <xsl:if test="@hfile != ''"> 
     347                                            <xsl:text disable-output-escaping="yes">downloadAndProcessHierarchyFile('</xsl:text> 
     348                                            <xsl:text>sites/localsite/collect/</xsl:text><xsl:value-of select="$collName"/><xsl:text>/etc/</xsl:text><xsl:value-of select="@hfile"/> 
     349                                            <xsl:text disable-output-escaping="yes">','</xsl:text><xsl:value-of select="@metadata"/><xsl:text disable-output-escaping="yes">');</xsl:text>                                           
     350                                        </xsl:if> 
     351                                    </xsl:for-each>                              
    350352                                <xsl:text disable-output-escaping="yes">});</xsl:text> 
    351353