Copied to clipboard

Flag this post as spam?

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


  • Shannon 148 posts 171 karma points
    May 23, 2011 @ 17:28
    Shannon
    0

    The case of the disappearing blog property entry.

    System Layout: I am using Windows Azure and the Umbraco / Azure Accelerator with 2 instances running.

    Mod: The only mod that I think would caus this is the following. I have a custom "Pageview" tracker that republishes the blog entry with an update to the number of pageviews using the following code.

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp "&#x00A0;"> ]>
    <xsl:stylesheet version="1.0"
      xmlns:cg="http://www.njection.com/schema"
      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" xmlns:tagsLib="urn:tagsLib" xmlns:BlogLibrary="urn:BlogLibrary" xmlns:UCommentLibrary="urn:UCommentLibrary" xmlns:uForum="urn:uForum" xmlns:uForum.raw="urn:uForum.raw"
      exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets tagsLib BlogLibrary UCommentLibrary uForum uForum.raw ">
      <xsl:output method="xml" omit-xml-declaration="yes"/>
      <xsl:param name="currentPage"/>
      <msxml:script language="C#" implements-prefix="cg">
        <msxml:assembly name="cms" />
        <msxml:assembly name="businesslogic" />
        <msxml:assembly name="umbraco" />
        <msxml:assembly name="umbraco.providers" />
        <msxml:using namespace="umbraco" />
        <msxml:using namespace="umbraco.BusinessLogic" />
        <msxml:using namespace="umbraco.cms.businesslogic" />
        <msxml:using namespace="umbraco.cms.businesslogic.web" />
        <msxml:using namespace="umbraco.providers" />
          public void IncrementPage(int pageId) {
            Document d = new Document(pageId);
            if (d.getProperty("pageViewCount") != null) {
              if (!String.IsNullOrEmpty(Convert.ToString(d.getProperty("pageViewCount").Value))) {
              // It has value - add 1 to it
                d.getProperty("pageViewCount").Value = Convert.ToInt32(d.getProperty("pageViewCount").Value) + 1;
              } else {
              // It's null - first pageview
                d.getProperty("pageViewCount").Value = 1;
              }
              d.Save();
              d.Publish(new User(0));
              library.UpdateDocumentCache(d.Id);
            }
          }
      </msxml:script>
      <xsl:template match="/">
        <xsl:value-of select="cg:IncrementPage($currentPage/@id)" />
      </xsl:template>
    </xsl:stylesheet>

    This is used for my nivo rotating banner to display the most viewed blogs over a 24 hour period. (http://www.njection.com) The banner at the top.

    What I've noticed is that I have to go back and look at the roll back log for the blog entry, I see that different entries get removed/disappear after they are published. Has anyone seen this before?

Please Sign in or register to post replies

Write your reply to:

Draft