Fixed BrowseProperties for UserControl Macros, fixes #30807

This commit is contained in:
agrath@gmail.com
2012-05-05 15:21:33 -12:00
parent e26f0f96c2
commit 63c19ebf03
2 changed files with 28 additions and 13 deletions

View File

@@ -40,13 +40,23 @@ namespace umbraco.developer
{
isUserControl = true;
string fileName = Request.QueryString["fileName"];
if (!fileName.StartsWith("~"))
{
if (fileName.StartsWith("/"))
{
fileName = "~" + fileName;
}
else
{
fileName = "~/" + fileName;
}
}
IOHelper.ValidateEditPath(fileName, SystemDirectories.Usercontrols);
if (System.IO.File.Exists(IOHelper.MapPath("~/" + fileName)))
if (System.IO.File.Exists(IOHelper.MapPath(fileName)))
{
UserControl oControl = (UserControl)LoadControl(@"~/" + fileName);
UserControl oControl = (UserControl)LoadControl(fileName);
type = oControl.GetType();
}
@@ -164,14 +174,19 @@ namespace umbraco.developer
string _macroPropertyTypeAlias = findMacroType(macroPropertyTypes, li.Value);
if (_macroPropertyTypeAlias == "")
_macroPropertyTypeAlias = "text";
int macroPropertyTypeId = int.Parse(macroPropertyIds[_macroPropertyTypeAlias].ToString());
MacroProperty.MakeNew(macroObject,
true,
li.Text.Substring(0, li.Text.IndexOf(" ")),
spaceCamelCasing(li.Text),
macroPropTypes.Find(delegate(MacroPropertyType mpt) { return mpt.Id == macroPropertyTypeId; }));
object propertyId = macroPropertyIds[_macroPropertyTypeAlias];
if (propertyId != null)
{
int macroPropertyTypeId = 0;
if(int.TryParse(string.Format("{0}", propertyId), out macroPropertyTypeId))
{
MacroProperty.MakeNew(macroObject,
true,
li.Text.Substring(0, li.Text.IndexOf(" ")),
spaceCamelCasing(li.Text),
macroPropTypes.Find(delegate(MacroPropertyType mpt) { return mpt.Id == macroPropertyTypeId; }));
}
}
}
else if (li.Selected)
result += "<li>Skipped: " + spaceCamelCasing(li.Text) + " (already exists as a parameter)</li>";

View File

@@ -39,8 +39,8 @@
<Examine configSource="config\ExamineSettings.config" />
<ExamineLuceneIndexSets configSource="config\ExamineIndex.config" />
<appSettings>
<add key="umbracoDbDSN" value="server=.\mojosqlserver;database=v472;integrated security=false;user id=DBUSER;password=DBPASSWORD" />
<add key="umbracoConfigurationStatus" value="4.7.2" />
<add key="umbracoDbDSN" value="server=ssaolap01;database=udev;integrated security=false;user id=dev;pwd=dev" />
<add key="umbracoConfigurationStatus" value="4.7.0" />
<add key="umbracoReservedUrls" value="~/config/splashes/booting.aspx,~/install/default.aspx,~/config/splashes/noNodes.aspx,~/VSEnterpriseHelper.axd" />
<add key="umbracoReservedPaths" value="~/umbraco,~/install/" />
<add key="umbracoContentXML" value="~/App_Data/umbraco.config" />