Fixes: Media, Selecting remove checkbox removes the image but does not remove its specifications

Work Items: 30254
This commit is contained in:
starfighter83
2011-04-20 06:52:28 -02:00
parent 47bd9180dc
commit 84c6913162

View File

@@ -91,6 +91,27 @@ namespace umbraco.editorControls
// set filename in db to nothing
_text = "";
_data.Value = _text;
//also clear umbracoWidth, umbracoHeight, umbracoExtension, umbracoBytes
cms.businesslogic.Content content = cms.businesslogic.Content.GetContentFromVersion(this._data.Version);
foreach (string prop in "umbracoExtension,umbracoBytes,umbracoWidth,umbracoHeight".Split(','))
{
try
{
content.getProperty(prop).Value = string.Empty;
noEdit bytesControl = uploadField.FindControlRecursive<noEdit>(this.Page, prop);
if (bytesControl != null)
{
bytesControl.RefreshLabel(string.Empty);
}
}
catch {
//if first one fails we can assume that props don't exist
break;
}
}
}
if (this.PostedFile != null)