U4-4059 - Update MNTP snippets for string of id's rather than old xml fragment

Created by Douglas Robar 16 Jan 2014, 11:19:01 Updated by Sebastiaan Janssen 16 Jan 2014, 18:50:56

Seen in 7.0.2 (nightly build 240)

The snippet 'Multinode Tree-picker' uses .InnerText, which errors now that MNTP returns a comma-separated string of ids rather than an xml fragment of ids. (see U4-3776 for background)

The correct snippet should now be:

    @foreach(var id in CurrentPage.PropertyWithPicker.Split(',')){
    	@*For each link, get the node, and display its name and url*@
    	var content = Umbraco.Content(id);
    	
    	<li><a href="@content.Url">@content.Name</a></li>	
    }
    
{code}

Notice the addition of .Split(',') and the removal of .InnerText.

This change applies to snippets in these areas:

  • Partial Views
  • Scripting Files
  • Partial View Macro Files

Comments

Sebastiaan Janssen 16 Jan 2014, 18:50:48

Fixed in rev c2ee3303a552a579d7acc74fe8bc1cb0e5c1eca3


Priority: Normal

Type: Bug

State: Fixed

Assignee:

Difficulty: Normal

Category:

Backwards Compatible: True

Fix Submitted:

Affected versions: 7.0.1

Due in version: 7.0.2

Sprint:

Story Points:

Cycle: