Fixes 29584 and 29585

[TFS Changeset #80854]
This commit is contained in:
hartvig
2010-11-29 14:34:05 +00:00
parent 190419393e
commit bc6cc2ac00
4 changed files with 29 additions and 11 deletions

View File

@@ -10,6 +10,7 @@ using umbraco.cms.businesslogic.cache;
using umbraco.cms.businesslogic.datatype;
using umbraco.cms.businesslogic.language;
using umbraco.cms.businesslogic.propertytype;
using umbraco.cms.businesslogic.web;
using umbraco.DataLayer;
[assembly: InternalsVisibleTo("Umbraco.Test")]
@@ -761,6 +762,15 @@ namespace umbraco.cms.businesslogic
Cache.ClearCacheItem(GetPropertiesCacheKey());
ClearVirtualTabs();
// clear anything that uses this as master content type
if (this.nodeObjectType == DocumentType._objectType)
{
List<DocumentType> cacheToFlush = DocumentType.GetAllAsList().FindAll(dt => dt.MasterContentType == Id);
foreach(DocumentType dt in cacheToFlush)
FlushFromCache(dt.Id);
}
}
protected internal void FlushAllFromCache()

View File

@@ -322,7 +322,8 @@ namespace umbraco.cms.businesslogic.propertytype
FlushCache();
// clean all properties on inherited document types (if this propertytype is removed from a master)
DocumentType.GetAllAsList().FindAll(dt => dt.MasterContentType == _contenttypeid).ForEach(dt => cleanPropertiesOnDeletion(dt.Id));
cleanPropertiesOnDeletion(_contenttypeid);
// DocumentType.GetAllAsList().FindAll(dt => dt.MasterContentType == _contenttypeid).ForEach(dt => cleanPropertiesOnDeletion(dt.Id));
// Delete all properties of propertytype
cleanPropertiesOnDeletion(_contenttypeid);
@@ -337,6 +338,10 @@ namespace umbraco.cms.businesslogic.propertytype
private void cleanPropertiesOnDeletion(int contentTypeId)
{
// first delete from all master document types
DocumentType.GetAllAsList().FindAll(dt => dt.MasterContentType == contentTypeId).ForEach(dt => cleanPropertiesOnDeletion(dt.Id));
// then remove from the current doc type
var objs = Content.getContentOfContentType(new ContentType(contentTypeId));
foreach (Content c in objs.ToList())
{

View File

@@ -270,7 +270,7 @@ namespace umbraco.controls
private void addControlNew(Property p, TabPage tp, string Caption)
{
IDataType dt = p.PropertyType.DataTypeDefinition.DataType;
dt.DataEditor.Editor.ID = p.PropertyType.Alias;
dt.DataEditor.Editor.ID = string.Format("prop_{0}", p.PropertyType.Alias);
dt.Data.PropertyId = p.Id;
// check for buttons

View File

@@ -322,11 +322,14 @@ jQuery(function() { refreshDropDowns(); });
propSort.ID = "propSort_" + t.Id.ToString() + "_Content";
PropertyTypes.Controls.Add(propSort);
_sortLists.Add(propSort);
PropertyTypes.Controls.Add(new LiteralControl("<ul class='genericPropertyList' id=\"t_" + t.Id.ToString() + "_Contents\">"));
foreach (cms.businesslogic.propertytype.PropertyType pt in t.PropertyTypes)
var pts = t.PropertyTypes.Where(pt => pt.ContentTypeId == cType.Id);
if (pts.Count() > 0)
{
if (pt.ContentTypeId == cType.Id)
PropertyTypes.Controls.Add(new LiteralControl("<ul class='genericPropertyList' id=\"t_" + t.Id.ToString() + "_Contents\">"));
foreach (cms.businesslogic.propertytype.PropertyType pt in pts)
{
GenericProperties.GenericPropertyWrapper gpw = new umbraco.controls.GenericProperties.GenericPropertyWrapper();
@@ -350,12 +353,10 @@ jQuery(function() { refreshDropDowns(); });
counter++;
hasProperties = true;
}
PropertyTypes.Controls.Add(new LiteralControl("</ul>"));
}
PropertyTypes.Controls.Add(new LiteralControl("</ul></div>"));
var jsSortable = @"
(function($) {
var propSortId = ""#" + propSort.ClientID + @""";
@@ -374,10 +375,12 @@ jQuery(function() { refreshDropDowns(); });
addNoPropertiesDefinedMessage();
}
PropertyTypes.Controls.Add(new LiteralControl("</div>"));
}
else
{
addNoPropertiesDefinedMessage();
PropertyTypes.Controls.Add(new LiteralControl("</div>"));
}
}
@@ -446,7 +449,7 @@ jQuery(function() { refreshDropDowns(); });
if (!propertyTabHasProperties)
{
PropertyTypes.Controls.Add(new LiteralControl("<div style=\"margin: 10px; padding: 4px; border: 1px solid #ccc;\">No properties defined on this tab. Click on the \"add a new property\" link at the top to create a new property.</div></div>"));
PropertyTypes.Controls.Add(new LiteralControl("<div style=\"margin: 10px; padding: 4px; border: 1px solid #ccc;\">No properties defined on this tab. Click on the \"add a new property\" link at the top to create a new property.</div>"));
PropertyTypes.Controls.Remove(PropertyTypes.FindControl("propertiesPH"));
}
else
@@ -456,7 +459,7 @@ jQuery(function() { refreshDropDowns(); });
private void addNoPropertiesDefinedMessage()
{
PropertyTypes.Controls.Add(new LiteralControl("<div style=\"margin: 10px; padding: 4px; border: 1px solid #ccc;\">No properties defined on this tab. Click on the \"add a new property\" link at the top to create a new property.</div></div>"));
PropertyTypes.Controls.Add(new LiteralControl("<div style=\"margin: 10px; padding: 4px; border: 1px solid #ccc;\">No properties defined on this tab. Click on the \"add a new property\" link at the top to create a new property.</div>"));
}
protected void gpw_Delete(object sender, System.EventArgs e)