Fix to macro container bug. Thank you to the 'mysterious patcher'. Work items: 29874

This commit is contained in:
hartvig
2011-02-22 09:11:45 -01:00
parent 970903eb2a
commit 33741210b3
2 changed files with 214 additions and 210 deletions

View File

@@ -63,15 +63,11 @@ namespace umbraco.editorControls.macrocontainer
// with _macroSelectDropdown.Items.Add(new ListItem(GetMacroNameFromAlias(item), item));
private string GetMacroNameFromAlias(string alias)
{
umbraco.DataLayer.IRecordsReader dr = umbraco.BusinessLogic.Application.SqlHelper.ExecuteReader("select macroName from cmsMacro where macroAlias = @alias",
umbraco.BusinessLogic.Application.SqlHelper.CreateParameter("@alias", alias));
if (dr.Read())
return dr.GetString("macroName");
else
return string.Empty;
var macro = umbraco.macro.ReturnFromAlias(alias);
return macro == null ? string.Empty : macro.Name;
}
void _delete_Click(object sender, EventArgs e)
{
_macroSelectDropdown.SelectedIndex = 0;