U4-2302 - Breaking change in 6.1? Macro parameter "contentPicker" no longer passes an id, but a node

Created by Bo Kingo Damgaard 31 May 2013, 06:58:41 Updated by Sebastiaan Janssen 05 Jun 2015, 16:28:23

I've upgraded from 6.0.5 to 6.1 and now I get a node instead of a node id in my xslt.

I have a macro with the following parameter: alias:folderId, name:Folder, type:contentPicker

In my xslt I've defined a variable: <xsl:variable name="folderId" select="/macro/folderId" />

In 6.0.5 I could call this: <xsl:variable name="sponsors" select="umbraco.library:GetXmlNodeById($folderId)//Sponsor" />

and this would give me nodeset of Sponsor children

In 6.1 I have to call it like this: <xsl:variable name="sponsors" select="umbraco.library:GetXmlNodeById($folderId/Sponsorer/@id)//Sponsor" />

because I have a node

1 Attachments

Download umbraco.zip

Comments

Sebastiaan Janssen 31 May 2013, 08:27:19

Hey Bo, I think someone may have been refactoring a little bit to much. It looks like this might fix it, could you try to drop this umbraco.dll in your bin folder and see if the issue goes away? Just making sure that it's actually fixed before I commit this!

Thanks in advance! :)


Bo Kingo Damgaard 31 May 2013, 09:41:09

I get this exception with that dll, even if I change the variable to the old "format":

Exception information: Exception type: InvalidOperationException Exception message: Cannot import a null node. at System.Xml.XmlDocument.ImportNodeInternal(XmlNode node, Boolean deep) at umbraco.macro.AddMacroXmlNode(XmlDocument umbracoXml, XmlDocument macroXml, String macroPropertyAlias, String macroPropertyType, String macroPropertyValue) at umbraco.macro.LoadMacroXslt(macro macro, MacroModel model, Hashtable pageElements, Boolean throwError) at umbraco.macro.renderMacro(Hashtable pageElements, Int32 pageId) at umbraco.macro.renderMacro(Hashtable attributes, Hashtable pageElements, Int32 pageId) at umbraco.presentation.templateControls.Macro.CreateChildControls() at System.Web.UI.Control.EnsureChildControls() at umbraco.presentation.templateControls.Macro.OnInit(EventArgs e) at System.Web.UI.Control.InitRecursive(Control namingContainer) at System.Web.UI.Control.InitRecursive(Control namingContainer) at System.Web.UI.Control.InitRecursive(Control namingContainer) at System.Web.UI.Control.InitRecursive(Control namingContainer) at System.Web.UI.Control.InitRecursive(Control namingContainer) at System.Web.UI.Control.InitRecursive(Control namingContainer) at System.Web.UI.Control.InitRecursive(Control namingContainer) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)


Sebastiaan Janssen 31 May 2013, 10:49:36

Ah damn, I'm an idiot, apologies, I posted an older dll! Sorry, this new one should work.


Bo Kingo Damgaard 31 May 2013, 10:58:35

Much better Sebastiaan. Thanks. Btw: you attached two files the second time. It's the left one, that is correct


Sebastiaan Janssen 31 May 2013, 11:14:17

yeah, the right one was deleted but I'm not sure why it's still downloadable.. hehe Thanks for confirming, I've commited the code for 6.1.1. Changeset 31419384e283


Priority: Normal

Type: Bug

State: Fixed

Assignee:

Difficulty: Normal

Category:

Backwards Compatible: True

Fix Submitted:

Affected versions: 6.1.0

Due in version: 6.1.1

Sprint:

Story Points:

Cycle: