简体   繁体   English

奇怪的内容和已删除的页面仍然可以在Umbraco中查看

[英]Strange Content and Deleted page is still viewable in Umbraco

I am running umbraco v 4.0.3. 我正在运行umbraco v 4.0.3。 My web server is Windows Server 2003. 我的Web服务器是Windows Server 2003。

I noticed that one of my pages was being displayed with content from a parent node in addition to the of the control it hosted. 我注意到,除了其中托管的控件之外,还显示了我的其中一个页面以及来自父节点的内容。 Since the page only serves as a host for an ascx control, it has no content of its own. 由于该页面仅充当ascx控件的宿主,因此它没有自己的内容。

The content area of the node is empty, so I am at a loss of where this content is coming from. 节点的内容区域为空,所以我不知道该内容的来源。

I have done the following things to attempt to resolve the problem, but none of them resulted in the page in question changing at all. 我已经做了以下尝试来解决问题的方法,但是这些都没有导致问题页面发生变化。 The page persists. 该页面仍然存在。

  • I've published the node again. 我再次发布了该节点。
  • I've clicked the unpublish button, and then published the node. 我单击了“取消发布”按钮,然后发布了该节点。
  • I've cleared my browsers cache. 我已经清除了浏览器缓存。
  • I've used multiple browsers. 我使用了多个浏览器。
  • I've used the incognito mode on Chrome. 我在Chrome上使用了隐身模式。
  • I've changed the template the node is based on, which should have prevented the macro from running, but it didn't. 我已经更改了节点所基于的模板,这应该阻止了宏的运行,但实际上并没有。
  • I've added content to the node. 我已将内容添加到节点。 The new content didn't show up. 新内容未显示。
  • I've changed the node's name. 我已经更改了节点的名称。 When I reload the page under it's old name, it's still there. 当我以旧名称重新加载页面时,它仍然存在。
  • I've touched web.config to restart the application. 我触摸过web.config以重新启动应用程序。 There was no change. 没有变化。
  • I've stopped and started the website. 我已经停止并启动了该网站。
  • I've right clicked on the top node of the site, and choose "republish" 我右键单击该网站的顶部节点,然后选择“重新发布”
  • I've manually deleted the umbraco.conf file under the data folder. 我已经手动删除了数据文件夹下的umbraco.conf文件。
  • I've even deleted the node. 我什至删除了该节点。

Nothing I do changes what appears when I navigate to the page. 导航到页面时,我没有做任何更改 At this point, I should get a 404, but the page still loads and still runs the macro. 在这一点上,我应该得到一个404,但是页面仍然加载并仍然运行宏。

At this point, I am at a loss of what to do, but I'm guessing it has something to do with IIS or Dot.Net and caching. 在这一点上,我不知所措,但是我猜想它与IIS或Dot.Net和缓存有关。

Does anybody have an idea how to fix this? 有人知道如何解决此问题吗?

EDIT 编辑

I have found that if I removed an XSLT macro reference from the template upon which the deleted page was built, the duplication of the parent page goes away when the deleted page loads in the browser. 我发现,如果我从构建删除页面的模板上删除了XSLT宏引用,则当在浏览器中加载删除页面时,父页面的复制就会消失。 Since this was my primary problem, I've recreated the page and have gone on. 由于这是我的主要问题,因此我重新创建了页面并继续。 I am still perplexed as to why the page I deleted was able to be loaded from multiple browsers. 我仍然困惑为什么删除的页面能够从多个浏览器加载。

The macro I removed is used in the majority of the 1,500+ pages of our web site, and on none of them does it reproduce the parent's document on the child, nor does it seem possible to me that an XSLT macro can reach outside of the XML cache. 我删除的宏用于我们网站的1,500多个页面中的绝大部分,并且在这些页面上都没有复制该宏在孩子身上的文档,在看来XSLT宏也无法到达该宏之外。 XML缓存。 I've reviewed the code, and didn't see any references to an additional data store. 我已经查看了代码,但没有看到对其他数据存储的任何引用。 I confess that XSLT is quite new to me. 我承认XSLT对我来说还是很新的。

The code for the macro whose reference I removed is listed below. 下面列出了我删除了其引用的宏的代码。

<?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:custom="urn:custom.library"
  exclude-result-prefixes="msxml umbraco.library custom">


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

<msxml:script language="C#" implements-prefix="custom">

  public System.Xml.XPath.XPathNodeIterator SplitMultiPageText(string unsplitText, 
                                                               string pageDelimeter) {
    System.Xml.XmlDocument xmlDoc = new System.Xml.XmlDocument();
    string[] splitPages = System.Text.RegularExpressions.Regex.Split(unsplitText, pageDelimeter);

    System.Xml.XmlElement pagesElement = xmlDoc.CreateElement("pages");

    foreach (string page in splitPages) {
      System.Xml.XmlElement pageElement = xmlDoc.CreateElement("page");
      pageElement.AppendChild(xmlDoc.CreateCDataSection(page));
      pagesElement.AppendChild(pageElement);
    }

    return pagesElement.CreateNavigator().Select(".");
  }

</msxml:script>

<xsl:param name="currentPage"/>

<xsl:variable name="content" select="/macro/content" />
<xsl:variable name="pageNumber" select="/macro/pageNumber" />
<xsl:variable name="joinContent">
  <xsl:choose>
    <xsl:when test="/macro/joinContent = ''">
      <xsl:value-of select="boolean(false)" />
    </xsl:when>
    <xsl:otherwise><xsl:value-of select="/macro/joinContent" /></xsl:otherwise>
  </xsl:choose>
</xsl:variable>

<xsl:variable name="splitExpr">&lt;hr class=&quot;pagebreak&quot; /&gt;</xsl:variable>

<xsl:template match="/">

  <xsl:variable name="pages" select="custom:SplitMultiPageText($content, $splitExpr)" />
  <xsl:variable name="pageCount" select="count($pages/page)" />

  <xsl:choose>
    <xsl:when test="$pageCount = 1 or string($joinContent) = 'true'">


      <xsl:for-each select="$pages/page">
        <xsl:value-of
          select="umbraco.library:RenderMacroContent(., $currentPage/@id)"
          disable-output-escaping="yes" />
      </xsl:for-each>

    </xsl:when>
    <xsl:otherwise>
      <p class="multiPageNotice">This document is split among multiple pages. To view
      the other pages, use the <strong>page selector</strong> near the bottom of the screen.</p>
      <xsl:for-each select="$pages/page">
        <xsl:if test="position() = $pageNumber or ( $pageNumber = '' and position() = 1 )">
          <xsl:value-of
            select="umbraco.library:RenderMacroContent(., $currentPage/@id)"
            disable-output-escaping="yes" />
        </xsl:if>
      </xsl:for-each>
    </xsl:otherwise>
  </xsl:choose>


  <xsl:if test="$pageCount &gt; 1 and string($joinContent) != 'true'">
    <div class="pageSelector">
      <p>Page: </p>
      <ul>
        <xsl:for-each select="$pages/page">
          <li>
            <xsl:choose>
              <xsl:when test="position() = $pageNumber or ( $pageNumber = '' and position() = 1 )">
                <xsl:value-of select="position()" />
              </xsl:when>
              <xsl:otherwise>
                <a href="{umbraco.library:NiceUrl($currentPage/@id)}/page/{position()}">
                  <xsl:value-of select="position()" />
                </a>
              </xsl:otherwise>
            </xsl:choose>
          </li>
        </xsl:for-each>
      </ul>
    </div>
  </xsl:if>

</xsl:template>

</xsl:stylesheet>

Given your comment, it's possible that the macro persists content to a store that is independent of the application/umbraco config, eg an xml file or a db-based session. 根据您的评论,宏可能会将内容持久保存到与应用程序/ umbraco配置无关的存储中,例如xml文件或基于db的会话。 This would obviously persist the data outside of the application restarting. 显然,这将在应用程序重新启动之外保留数据。 Obviously, we would have to see the code for the macro though. 显然,我们将不得不看到宏的代码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM