4

I have an error occurring when publishing a component to the staging publication target. It works fine when publishing to the Live target just not staging. The error I am getting is

Operation is not supported on a new item or on a null URI.

The full stack trace from the event log is below. Can anyone shed any light on what could be going on. I am currently checking each of the pages that the component is used on to see if a publishing issue is occurring on one of them but up to now nothing has shown up as an issue.

Component: Tridion.ContentManager.Publishing Errorcode: 805 User: NT AUTHORITY\SYSTEM

StackTrace Information Details: at Tridion.ContentManager.Session.GetTcmUri(String uri) at Tridion.ContentManager.Session.GetObject(String uri) at Tridion.ContentManager.Session.GetObject(XmlElement linkElement) at Tridion.ContentManager.ContentManagement.Fields.ComponentLinkField.ReadFromElement(XmlElement parentElement) at Tridion.ContentManager.ContentManagement.Fields.ItemFields.InitializeFields(XmlElement schemaFieldsElement, XmlElement contentContainer) at Tridion.ContentManager.ContentManagement.Fields.ItemFields..ctor(XmlElement rootElement, Schema schema) at Tridion.Extensions.Mediators.Razor.Models.ComponentModel.get_Fields() at Tridion.Extensions.Mediators.Razor.TridionRazorTemplate.get_Fields()
at Tridion.Extensions.Mediators.Razor.Templating.Rzr563c521b4aef4f9aa506e71d7385caa1Template.Execute() at Tridion.Extensions.Mediators.Razor.RazorHandler.CompileAndExecute(DateTime revisionDate, Engine engine, Package package) at Tridion.Extensions.Mediators.Razor.RazorMediator.Transform(Engine engine, Template template, Package package) at Tridion.ContentManager.Templating.Engine.ExecuteTemplate(Template template, Package package) at Tridion.ContentManager.Templating.Engine.InvokeTemplate(Package package, TemplateInvocation templateInvocation, Template template)
at Tridion.ContentManager.Templating.Compound.CompoundTemplateMediator.Transform(Engine engine, Template templateToTransform, Package package) at Tridion.ContentManager.Templating.Engine.ExecuteTemplate(Template template, Package package) at Tridion.ContentManager.Templating.Engine.InvokeTemplate(Package package, TemplateInvocation templateInvocation, Template template)
at Tridion.ContentManager.Templating.Engine.TransformItem(Template template, IdentifiableObject itemToRender) at Tridion.ContentManager.Templating.TemplatingRenderer.Render(ResolvedItem resolvedItem, PublishInstruction instruction, PublicationTarget target, RenderedItem renderedItem, RenderContext renderContext) at Tridion.ContentManager.Publishing.Rendering.RenderEngine.Render(ResolvedItem resolvedItem, PublishInstruction instruction, PublicationTarget target, RenderContext context) at Tridion.ContentManager.Publishing.Rendering.RenderEngine.Render(IdentifiableObject item, Template template, PublishInstruction instruction, PublicationTarget target, RenderContext context) at Tridion.ContentManager.Templating.Engine.RenderComponentPresentation(TcmUri componentUri, TcmUri componentTemplateUri) at Tridion.Extensions.Mediators.Razor.Models.ComponentPresentationModel.RenderComponentPresentation() at Tridion.Extensions.Mediators.Razor.Templating.Rzr542bcd5adbf747fd9ea83da28be8f74cTemplate.Execute() at Tridion.Extensions.Mediators.Razor.RazorHandler.CompileAndExecute(DateTime revisionDate, Engine engine, Package package) at Tridion.Extensions.Mediators.Razor.RazorMediator.Transform(Engine engine, Template template, Package package) at Tridion.ContentManager.Templating.Engine.ExecuteTemplate(Template template, Package package) at Tridion.ContentManager.Templating.Engine.InvokeTemplate(Package package, TemplateInvocation templateInvocation, Template template)
at Tridion.ContentManager.Templating.Compound.CompoundTemplateMediator.Transform(Engine engine, Template templateToTransform, Package package) at Tridion.ContentManager.Templating.Engine.ExecuteTemplate(Template template, Package package) at Tridion.ContentManager.Templating.Engine.InvokeTemplate(Package package, TemplateInvocation templateInvocation, Template template)
at Tridion.ContentManager.Templating.Engine.TransformItem(Template template, IdentifiableObject itemToRender) at Tridion.ContentManager.Templating.TemplatingRenderer.Render(ResolvedItem resolvedItem, PublishInstruction instruction, PublicationTarget target, RenderedItem renderedItem, RenderContext renderContext) at Tridion.ContentManager.Publishing.Rendering.RenderEngine.Render(ResolvedItem resolvedItem, PublishInstruction instruction, PublicationTarget target, RenderContext context) at Tridion.ContentManager.Publishing.Handling.DefaultPublishTransactionHandler.RenderAndPackage(ResolvedItem resolvedItem, PublishInstruction instruction, PublicationTarget target, List`1 processedItems, PublishTransaction publishTransaction, TransportPackage transportPackage) at Tridion.ContentManager.Publishing.Handling.DefaultPublishTransactionHandler.HandlePublishRequest(PublishTransaction publishTransaction) at Tridion.ContentManager.Publishing.Handling.DefaultPublishTransactionHandler.ProcessPublishTransaction(PublishTransaction publishTransaction) at Tridion.ContentManager.Publishing.Publisher.QueueMessageHandler.HandleMessage()

Adding Razor Template to Question

<div class="bb-ibe-carousel-container bb-ibe-carousel-itinerary" data-min-slides="1" data-max-slides="5">
    <div class="bb-ibe-carousel">

        @for (int i = 0; i < Fields.ibe_event.Count; i++)
        {
            var ibeEvent = @Fields.ibe_event[i];

            <div class="bb-ibe-slide">
                <div class="bb-ibe-article">
                    <div class="bb-ibe-article-header">
                        <h2>Day @ibeEvent.day</h2>
                    </div>
                    <div class="bb-ibe-article-thumb">
                        @if (ibeEvent.port.image != null)
                        {
                            <img src="@ibeEvent.port.image"   alt="@ibeEvent.port.image.Metadata.alt" />
                        }

                    </div>
                    <div class="bb-ibe-article-details">
                        <h3>@ibeEvent.port.title</h3>
                        <p>@ibeEvent.port.highlight</p>
                    </div>
                </div>
            </div>
        }
    </div>
    <div class=bb-ibe-carousel-pager-container>
        <ul class="bb-ibe-carousel-pager">
            @for (int i = 0; i < Fields.ibe_event.Count; i++)
            {
                var ibeEvent = @Fields.ibe_event[i];       


                <li><a data-slide-index="@i.ToString()" href="">
                    @if (ibeEvent.port.thumbnail != null)
                    {
                        <img src="@ibeEvent.port.thumbnail" alt="@ibeEvent.port.thumbnail.Metadata.alt" />
                    }
                </a></li>
            }

            </ul>
    </div>
    <ul class="bb-ibe-carousel-direction">
        <li class="bb-ibe-carousel-direction-next"></li>
        <li class="bb-ibe-carousel-direction-prev"></li>
    </ul>

</div>
<div class="bb-ibe-itinerary-content">
    <div class="bb-ibe-itinerary-content-image">
        @if (Component.image != null && Component.overlay_image != null)
        {
            <a href="@Component.Fields.overlay_image.ID" class="ibe-overlay-link"><img class="media-thumb" src="@Component.image" alt="@Component.image.Metadata.alt"     /></a>
        }
                else if (Component.image != null)
                {
                       <img class="media-thumb" src="@Component.image"     alt="@Component.image.Metadata.alt" />
             }
    </div>
    <div class="bb-ibe-itinerary-content-details">
        <h2>Cruise Itinerary</h2>

        <table class="bb-ibe-striped">
            <thead>
                <tr>
                    <th>Day</th>
                    <th>Port</th>
                    <th>Arrive</th>
                    <th>Depart</th>
                    <th>Activity</th>
                </tr>
            </thead>
            <tbody>
                @foreach (var ibeEvent in Fields.ibe_event)
                {
                    <tr>
                        <td>@ibeEvent.day</td>
                        <td>@ibeEvent.port.title</td>
                        <td>@ibeEvent.arrive</td>
                        <td>@ibeEvent.depart</td>
                        <td>@ibeEvent.activity</td>
                    </tr>
                }
            </tbody>
        </table>
    </div>
</div>
2
  • I guess the first thing to try to find out is what is the template doing. Can you post your Razor TBB?
    – Nuno Linhares
    Commented Dec 16, 2013 at 13:16
  • Hi Nuno... I have added the template in my question now. Thanks
    – mackie1908
    Commented Dec 16, 2013 at 13:35

1 Answer 1

6

The razor mediator is trying to find a component when the TcmId is null or empty.

If you look in your component's source tab there should be a component link element of some sort with an empty xlink:href attribute. Remove these and retry and you should be okay.

As to why these are there I'm not 100% sure. It seems most likely to be because the element has had it's XML set incorrectly (Maybe via the core service?) and this XML error is not validated correctly by Tridion.

2
  • 1
    This was it. The item was being imported via the Core Service and adding the XML nodes for the image and thumb fields but adding an emtpy href tag where the TCM ID should be instead of leaving the node out of the component XML.
    – mackie1908
    Commented Dec 16, 2013 at 14:35
  • I'd thought maybe it was that, but your question said it was working for one target and not the other. Commented Dec 16, 2013 at 19:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.