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>