1

When I try to use a component link in a RTF field (by using hyperlink) of a component, I get 'Value cannot be null.Parameter name: rootElement' error while publishing the corresponding page.

The publishing fails every-time and below is the error log:

Value cannot be null. Parameter name: rootElement. at Tridion.ContentManager.ContentManagement.Fields.ItemFields..ctor(XmlElement rootElement, Schema schema, Nullable`1 synchronizeFlags, LoadFlags loadFlags) at Tridion.ContentManager.ContentManagement.Fields.ItemFields..ctor(XmlElement rootElement, Schema schema) at Sdl.Web.Tridion.Templates.ResolveRichText.b__2(Match match) in D:\TBB\DXA-Templating\Sdl.Web.Templating\Common\ItemFieldsExtensions.cs:line 111 at System.Text.RegularExpressions.RegexReplacement.Replace(MatchEvaluator evaluator, Regex regex, String input, Int32 count, Int32 startat)
at System.Text.RegularExpressions.Regex.Replace(String input, MatchEvaluator evaluator) at System.Text.RegularExpressions.Regex.Replace(String input, String pattern, MatchEvaluator evaluator) at Sdl.Web.Tridion.Templates.ResolveRichText.ResolveJsonContent(String content) in D:\TBB-DXA-Templating\Sdl.Web.Templating\Common\ItemFieldsExtensions.cs:line 70 at Sdl.Web.Tridion.Templates.ResolveRichText.Transform(Engine engine, Package package) in D:\TBB\DXA-Templating\Sdl.Web.Templating\Common\ItemFieldsExtensions.cs:line 66 at Tridion.ContentManager.Templating.Assembly.AssemblyMediator.Transform(Engine engine, Template template, Package package) at Tridion.ContentManager.Templating.Assembly.CSharpSourceCodeMediator.RunTemplate(Engine engine, Package package, String templateUri, String className) at Tridion.Templating.CSharpTemplate.CSharpSourceTemplate.Transform(Engine __engine, Package __package) at Tridion.ContentManager.Templating.Assembly.CSharpSourceCodeMediator.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.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.Debugging.DebuggingEngine.Run()
at Tridion.ContentManager.Templating.Debugging.DebugSession.Run()

The component link works fine for multimedia items. Any idea about this issue?

  • 1
    Sounds like a bug in the DXA templating code ResolveRichText TBB... does the schema of your linked component have metadata? If not can you try adding a metadata field? – Will Price Oct 7 '15 at 8:51
  • It worked after I added a metadata field....So this is perhaps why multimedia items are working (since they have metadata fields)? What can be a proper solution? (We are using beta version of java dxa. ) – Huston Lopes Oct 7 '15 at 9:17
2

This looks like a bug in the ResolveRichText TBB. This TBB puts metadata from the linked component into data attributes on link, which can then be read and used for processing when the content is being rendered (an example of this is the YouTube video YouTubeId, which enables the link to be converted into an embedded video). I guess there is a problem if there is no metadata. Looking at the latest DXA source code for the template this should not be a problem, as it does a check to see if the meta is not null. I guess you are using an older version of the source (perhaps this one), in which case you will need to either upgrade DXA to the latest, or manually patch the TBB code yourself.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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