Copied to clipboard

Flag this post as spam?

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


  • Jon Dunfee 199 posts 468 karma points
    May 26, 2014 @ 16:25
    Jon Dunfee
    0

    XSLT use of umbraco.library:GetCurrentMember() in 6.2 no longer working

    I'm evaluating the upgrade from 6.1.6 to 6.2.0 and it would appear the use of umbraco.library:GetCurrentMember()/@id is no longer working.  I'm receiving an error, "Value was either too large or too small for an Int32." when passing to a method expecting an Int.  I didn't see a ticket on the issue, so thought I'd hit the community first.

  • Palle Hansen 143 posts 396 karma points
    May 27, 2014 @ 14:53
    Palle Hansen
    0

    Hi Jon.

    I'm getting the same error.
    Can't find any description for a solution.

    Any one.

    /Palle 

  • Jon Dunfee 199 posts 468 karma points
    May 27, 2014 @ 15:39
    Jon Dunfee
    0

    I'm in the process of testing and replacing all the umbraco.library:GetCurrentMember()/@id calls with my own method:

    <?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:msxsl="urn:schemas-microsoft-com:xslt"
    xmlns:umbraco.library="urn:umbraco.library"
    xmlns:umbraco.page="urn:umbraco.page"
    exclude-result-prefixes="msxml umbraco.library umbraco.page">
    
    ...
      <msxsl:script language="C#" implements-prefix="umbraco.page"> ... <msxsl:assembly name="System.Web"/> <msxsl:assembly name="System.Web.ApplicationServices"/> ... <msxsl:using namespace="System.Web.Security"/><![CDATA[  public static int CurrentMemberId() { var m = Membership.GetUser(); return (m == null) ? 0 : (int) m.ProviderUserKey; } ]]> </msxsl:script>  

     Then replace with umbraco.page:CurrentMemberId() so far it seems to be working.  If someone else has a better solution, I'm all ears.

  • Palle Hansen 143 posts 396 karma points
    May 27, 2014 @ 16:40
    Palle Hansen
    0

    Great work.
    Yes it semme to work.

    But how do you get @nodeName and @loginName etc..

     

    /Palle 

  • Jon Dunfee 199 posts 468 karma points
    May 27, 2014 @ 17:03
    Jon Dunfee
    0

    You can create additional methods to return any of the details you need.  Feels like a workaround, imho.  I would hate to see XSLT be forgotten.  I still use it particularly when performing Descendant() operations which is gawd-aweful slow with Razor in comparison.

  • Palle Hansen 143 posts 396 karma points
    May 28, 2014 @ 08:04
    Palle Hansen
    0

    Okay Thanks.

     

  • Charles Afford 1163 posts 1709 karma points
    May 28, 2014 @ 09:39
    Charles Afford
    0

    Yea thats what i would do.  Create a helper method in complied code and then use that.  I would add this to: 

    http://issues.umbraco.org/dashboard

    Charlie :)

Please Sign in or register to post replies

Write your reply to:

Draft