Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Matt Watson 33 posts 55 karma points
    Aug 15, 2011 @ 12:02
    Matt Watson
    0

    Browser specific issues for GetCurrentMember()

    Hi all,

    Umbraco n00b here, so appologies in advance for sounding dumb. I can only assume the issue is my cache, but no matter what I do to clear it, I still get the following issue.

    I seem to have a very tricky issue in relation what browser I'm using, and the result of the "GetCurrentMember()" function in XLST.

    I have success if I view the site in (these are all running on a Vista box)

    • Chrome
    • IE9
    • Firefox 5 
    However if I boot up my XP box and test the site, It fails when viewing in
    • IE7
    • Firefox 4

    I have searched the forums, but I have not found anything that matches my problem as yet. My problem is creating an XLST Macro using the following code:

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp "&#x00A0;"> ]>
    <xsl:stylesheet 
      version="1.0" 
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
      xmlns:msxml="urn:schemas-microsoft-com:xslt"
      xmlns:umbraco.library="urn:umbraco.library" xmlns:Exslt.ExsltCommon="urn:Exslt.ExsltCommon" xmlns:Exslt.ExsltDatesAndTimes="urn:Exslt.ExsltDatesAndTimes" xmlns:Exslt.ExsltMath="urn:Exslt.ExsltMath" xmlns:Exslt.ExsltRegularExpressions="urn:Exslt.ExsltRegularExpressions" xmlns:Exslt.ExsltStrings="urn:Exslt.ExsltStrings" xmlns:Exslt.ExsltSets="urn:Exslt.ExsltSets" 
      exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets ">

    <xsl:output method="xml" omit-xml-declaration="yes"/>

    <xsl:param name="currentPage"/>
    <xsl:variable name="currentMemberName" select="umbraco.library:GetCurrentMember()" />

    <xsl:template match="/">
      <xsl:value-of select="$currentMemberName/@nodeName" /> 
    </xsl:template>

    </xsl:stylesheet>

    This macro works fine in the working browsers returing the expected result "Example Member", but if I in any other browser I get no result. 

    I changed the code to output the XML by using the following line:

    <xsl:copy-of select="$currentMemberName" /> 

    When viewing source on the non-working browsers I get the following XML output:

    <error>No current member exists (best practice is to validate with 'isloggedon()' prior to this call)</error>

    As XSLT is server side (am I right here) there shouldnt be any issue caused by the browser I am viewing it in should there?

    Thanks for your help,

    Matt

  • Chriztian Steinmeier 2798 posts 8787 karma points MVP 7x admin c-trib
    Aug 15, 2011 @ 12:48
    Chriztian Steinmeier
    1

    Hi Matt,

    You're right - XSLT is serverside, so the issue is bound to be somehow related to cookies. The error you're getting basically means that the browser has no session for a member, so whichever Member login method you're using fails in those browsers.

    /Chriztian

  • Matt Watson 33 posts 55 karma points
    Aug 15, 2011 @ 16:54
    Matt Watson
    0

    Thank you for your reply :) I'll check out the cookie issue.

    I would "High five" your answer, but I dont have any Kama points yet.

  • Chriztian Steinmeier 2798 posts 8787 karma points MVP 7x admin c-trib
    Aug 15, 2011 @ 23:31
    Chriztian Steinmeier
    0

    No worries, Matt - most of us are here to help; not for the Karma :-)

    /Chriztian

Please Sign in or register to post replies

Write your reply to:

Draft