Copied to clipboard

Flag this post as spam?

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


  • titorge 14 posts 28 karma points
    Dec 16, 2009 @ 15:12
    titorge
    0

    Problem with GetCurrentMember

    umbraco v 4.0.2.1 (Assembly version: 1.0.3441.17657)

    I've made an usercontrol (using the Umbraco API) for letting members add/edit their properties. My usercontrol works fine and the new/modified data is stored in the DB. This is confirmed by checking the umbraco backend. Also the usercontrol form is correctly updated.

    I also use an XSLT on other pages to display some of these properties. I'm using <xsl:variable name="member" select="umbraco.library:GetCurrentMember()" /> to retrieve the data and then retrieving the correct property by<xsl:variable name="aVariableName" select="$member/data [@alias='propertyName']" />.

    For existing members, who have logged in earlier and set/modified the properties, this works perfectly. They use the user control and the new data is displayed on each page.

    However, when a new member logs in and modifies (actually setting) their properties, the DB is updated but the Xslt doesn't show the changes. I've discovered that when updating the usercontrol (the dll file itself), umbraco does something (I'm guessing rebuilding a cache or something) which makes the Xslt work for the new members.

    The submit button ends with the following code

    member.XmlGenerate(new System.Xml.XmlDocument());
    member.Save();
    Member.RemoveMemberFromCache(member.Id);
    Member.ClearMemberFromClient(member.Id);
    Member.AddMemberToCache(member);

    I'm guessing this is a bit of an overkill, but I've been struggeling for quite a while now.

    Thanks!

Please Sign in or register to post replies

Write your reply to:

Draft