简体   繁体   中英

Sitecore 6.6 Pipeline Fails to Run

I'm following this guide for dynamic placeholders and cannot get my getPlaceholderRenderings pipeline to run.

I cannot see why this pipeline isn't working:

<getPlaceholderRenderings>
  <processor type="Site.CMS.Specialization.Pipelines.GetDynamicKeyAllowedRenderings, Site.CMS"/>
  <processor type="Sitecore.Pipelines.GetPlaceholderRenderings.GetAllowedRenderings, Sitecore.Kernel"/>
  <processor type="Sitecore.Pipelines.GetPlaceholderRenderings.GetPredefinedRenderings, Sitecore.Kernel"/>
  <processor type="Sitecore.Pipelines.GetPlaceholderRenderings.RemoveNonEditableRenderings, Sitecore.Kernel"/>
  <processor type="Sitecore.Pipelines.GetPlaceholderRenderings.GetPlaceholderRenderingsDialogUrl, Sitecore.Kernel"/>
</getPlaceholderRenderings>

My processor looks like this:

public class GetDynamicKeyAllowedRenderings : GetAllowedRenderings
{
    public new void Process(GetPlaceholderRenderingsArgs args)
    {
        string placeholderKey = args.PlaceholderKey;

    }
}

At this stage I'm just testing that it runs. Which it doesn't.

I've done exactly what the guide says to do and yet this pipeline never runs. I've rebuilt countless times, recycled my application pool, and restarted IIS. None of which helps as when I debug my application with a break point in that pipeline it just isn't hit.

Update

I tested that my pipelines were being hit by adding the following code:

public class ExceptionThrower : HttpRequestProcessor
{
    public override void Process(HttpRequestArgs args)
    {
        throw new Exception("ExceptionThrower");
    }
}

And this line to the config:

<httpRequestBegin>
  <processor type="Site.CMS.Specialization.Pipelines.ExceptionThrower, SCW.CMS" />
  <processor type="Sitecore.Pipelines.PreprocessRequest.CheckIgnoreFlag, Sitecore.Kernel"/>
  <processor type="Sitecore.Pipelines.HttpRequest.EnsureServerUrl, Sitecore.Kernel"/>
  .
  .
  .
</httpRequestBegin>

This gets hit and I see the exception.

If I add it to getPlaceholderRenderings it doesn't get hit.

The example I've been following ( http://www.techphoria414.com/Blog/2011/August/Dynamic_Placeholder_Keys_Prototype ) has exactly the same name, inheritance and parameters as my original code.

I think that the problem is caused by inheritance from GetAllowedRenderings class and new keyword. Try not to inherit from GetAllowedRenderings and see it the breakpoint is hit:

public class GetDynamicKeyAllowedRenderings
{
    public void Process(GetPlaceholderRenderingsArgs args)
    {
        string placeholderKey = args.PlaceholderKey;

    }
}

Check also if the ShowConfig.aspx page shows your rendering in the merged configuration: http://localhost/sitecore/admin/showconfig.aspx

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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