Merge remote-tracking branch 'origin/v8/dev' into netcore/dev
# Conflicts: # src/Umbraco.Abstractions/Constants-AppSettings.cs # src/Umbraco.Abstractions/ContentVariationExtensions.cs # src/Umbraco.Abstractions/IMainDom.cs # src/Umbraco.Abstractions/PropertyEditors/MultiUrlPickerConfiguration.cs # src/Umbraco.Abstractions/Runtime/IMainDom.cs # src/Umbraco.Abstractions/Runtime/MainDom.cs # src/Umbraco.Core/IMainDom.cs # src/Umbraco.Core/MainDom.cs # src/Umbraco.Core/Umbraco.Core.csproj # src/Umbraco.Infrastructure/MainDom.cs # src/Umbraco.Infrastructure/Migrations/Upgrade/UmbracoPlan.cs # src/Umbraco.Infrastructure/Runtime/CoreRuntime.cs # src/Umbraco.Web.UI/Umbraco/config/lang/en.xml # src/Umbraco.Web/Models/Mapping/ContentTypeMapDefinition.cs # src/Umbraco.Web/PublishedCache/NuCache/ContentStore.cs # src/Umbraco.Web/UmbracoApplication.cs # src/Umbraco.Web/UmbracoComponentRenderer.cs
This commit is contained in:
@@ -1326,6 +1326,17 @@ WHERE {Constants.DatabaseSchema.Tables.Content}.nodeId IN (@ids) AND cmsContentT
|
||||
return Database.ExecuteScalar<int>(sql) > 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns true or false depending on whether content nodes have been created based on the provided content type id.
|
||||
/// </summary>
|
||||
public bool HasContentNodes(int id)
|
||||
{
|
||||
var sql = new Sql(
|
||||
$"SELECT CASE WHEN EXISTS (SELECT * FROM {Constants.DatabaseSchema.Tables.Content} WHERE contentTypeId = @id) THEN 1 ELSE 0 END",
|
||||
new { id });
|
||||
return Database.ExecuteScalar<int>(sql) == 1;
|
||||
}
|
||||
|
||||
protected override IEnumerable<string> GetDeleteClauses()
|
||||
{
|
||||
// in theory, services should have ensured that content items of the given content type
|
||||
|
||||
Reference in New Issue
Block a user