Fixes change doc type to use the prop alias instead of the guid

This commit is contained in:
Shannon
2013-09-21 12:40:04 +10:00
parent f30bac2919
commit 6340afce69
2 changed files with 3 additions and 5 deletions

View File

@@ -73,7 +73,7 @@
<%# DataBinder.Eval(Container, "DataItem.Name") %>
<asp:HiddenField ID="Alias" runat="server" Value='<%#DataBinder.Eval(Container, "DataItem.Alias")%>' />
<asp:HiddenField ID="Name" runat="server" Value='<%#DataBinder.Eval(Container, "DataItem.Name")%>' />
<asp:HiddenField ID="DataTypeId" runat="server" Value='<%#DataBinder.Eval(Container, "DataItem.DataTypeId")%>' />
<asp:HiddenField ID="PropertyEditorAlias" runat="server" Value='<%#DataBinder.Eval(Container, "DataItem.PropertyEditorAlias")%>' />
</td>
<td><asp:DropDownList id="DestinationProperty" runat="server" /></td>
</tr>

View File

@@ -141,13 +141,11 @@ namespace Umbraco.Web.UI.Umbraco.Dialogs
if (ri.ItemType == ListItemType.Item || ri.ItemType == ListItemType.AlternatingItem)
{
// Get data type from hidden field
var dataTypeId = Guid.Parse(((HiddenField)ri.FindControl("DataTypeId")).Value);
//TODO: Change this logic as it will not be backwards compatible with Belle if there's no GUID -> Alias mapping!
var propEdAlias = ((HiddenField)ri.FindControl("PropertyEditorAlias")).Value;
// Bind destination list with properties that match data type
var ddl = (DropDownList)ri.FindControl("DestinationProperty");
ddl.DataSource = properties.Where(x => x.DataTypeId == dataTypeId);
ddl.DataSource = properties.Where(x => x.PropertyEditorAlias == propEdAlias);
ddl.DataValueField = "Alias";
ddl.DataTextField = "Name";
ddl.DataBind();