Skip to content

Commit

Permalink
Release v.15.2.8400.0
Browse files Browse the repository at this point in the history
  • Loading branch information
nader-dab committed Oct 29, 2024
1 parent c998fd6 commit 5e64014
Show file tree
Hide file tree
Showing 37 changed files with 8,944 additions and 47,737 deletions.
8 changes: 4 additions & 4 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
<PackageVersion Include="Ninject.Web.Common" Version="3.2.3.0" />
<PackageVersion Include="RazorGenerator.MsBuild" Version="2.4.1" />
<PackageVersion Include="RazorGenerator.Mvc" Version="2.3.12" />
<PackageVersion Include="Telerik.Sitefinity.ServicesImpl" Version="15.1.8300" />
<PackageVersion Include="Telerik.Sitefinity.Core" Version="15.1.8300" />
<PackageVersion Include="Telerik.Sitefinity.Content" Version="15.1.8300" />
<PackageVersion Include="Telerik.Sitefinity.Mvc" Version="15.1.8300" />
<PackageVersion Include="Telerik.Sitefinity.ServicesImpl" Version="15.2.8400" />
<PackageVersion Include="Telerik.Sitefinity.Core" Version="15.2.8400" />
<PackageVersion Include="Telerik.Sitefinity.Content" Version="15.2.8400" />
<PackageVersion Include="Telerik.Sitefinity.Mvc" Version="15.2.8400" />
<PackageVersion Include="Telerik.DataAccess.Fluent" Version="2020.0.428.1" />
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
The Feather Project
The Feather Project
=======

This repository contains the core infrastructure related to [Project Feather](http://projectfeather.sitefinity.com).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ private void RegisteringScriptsHandler(IScriptsRegisteringEvent @event)

@event.Scripts.Add(new ScriptReference(UrlHelpers.AppendVersion(scriptRootPath + "Designers/Scripts/page-editor-services.js")));
@event.Scripts.Add(new ScriptReference(UrlHelpers.AppendVersion(scriptRootPath + "Designers/Scripts/page-editor.js")));

@event.Scripts.Add(new ScriptReference(UrlHelpers.AppendVersion(scriptRootPath + "Mvc/Scripts/LABjs/LAB.min.js")));

var currentPackage = new PackageManager().GetCurrentPackage();
Expand Down
9 changes: 3 additions & 6 deletions Telerik.Sitefinity.Frontend/Mvc/Helpers/CommentsHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -157,13 +157,10 @@ private static string GetDataSourceName(IDataItem item)

if (item != null && item is DynamicContent)
{
var moduleProvider = ModuleBuilderManager.GetManager().Provider;
var itemType = item.GetType().FullName;
var itemType = item.GetType();

var dynamicContentType = moduleProvider.GetDynamicModules()
.Where(m => m.Status == DynamicModuleStatus.Active)
.Join(moduleProvider.GetDynamicModuleTypes().Where(t => string.Concat(t.TypeNamespace, ".", t.TypeName) == itemType), m => m.Id, t => t.ParentModuleId, (m, t) => t)
.FirstOrDefault();
var dynamicContentType = ModuleBuilderManager.GetActiveTypes()
.FirstOrDefault(t => t.TypeNamespace == itemType.Namespace && t.TypeName == itemType.Name);

if (dynamicContentType != null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
using System.Web.Mvc;
using Telerik.Sitefinity.Abstractions;
using Telerik.Sitefinity.DynamicModules.Builder;
using Telerik.Sitefinity.DynamicModules.Builder.Model;
using Telerik.Sitefinity.Frontend.Mvc.Infrastructure.Controllers;
using Telerik.Sitefinity.Frontend.Mvc.Models;
using Telerik.Sitefinity.Frontend.Resources;
Expand Down Expand Up @@ -255,8 +256,8 @@ private string GetWidgetName(ControllerContext context)
if (model != null)
{
var contentType = model.ContentType;
var manager = ModuleBuilderManager.GetManager().Provider;
var dynamicType = manager.GetDynamicModuleTypes().FirstOrDefault(t => t.TypeName == contentType.Name && t.TypeNamespace == contentType.Namespace);

var dynamicType = ModuleBuilderManager.GetModules().GetTypeByFullName(contentType.FullName);
if (dynamicType != null)
return dynamicType.DisplayName;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
using ServiceStack.Text;
using System;
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Reflection;
using System.Web;
using System.Web.Mvc;
using ServiceStack.Text;
using Telerik.Sitefinity.Abstractions;
using Telerik.Sitefinity.Abstractions.VirtualPath;
using Telerik.Sitefinity.Data;
Expand All @@ -15,10 +15,10 @@
using Telerik.Sitefinity.Frontend.Mvc.Models;
using Telerik.Sitefinity.Frontend.Resources;
using Telerik.Sitefinity.Frontend.Resources.Resolvers;
using Telerik.Sitefinity.Security.Model;
using Telerik.Sitefinity.Security.Sanitizers;
using Telerik.Sitefinity.Services;
using Telerik.Sitefinity.Web;
using Telerik.Sitefinity.Web.OutputCache;
using Telerik.Sitefinity.Web.UI;
using Telerik.Sitefinity.Web.UI.ContentUI.Enums;

Expand All @@ -42,7 +42,7 @@ public static bool ShouldReturnDetails(this Controller controller, ContentViewDi
{
if (controller == null)
throw new ArgumentNullException("controller");

if (contentViewDisplayMode == ContentViewDisplayMode.Detail && viewModel != null)
{
return true;
Expand Down Expand Up @@ -136,23 +136,13 @@ public static void AddCacheDependencies(this Controller controller, IEnumerable<
if (keys == null)
throw new ArgumentNullException("keys");

if (SystemManager.CurrentHttpContext == null)
var httpContext = SystemManager.CurrentHttpContext;
if (httpContext == null)
throw new InvalidOperationException("Current HttpContext is null. Cannot add cache dependencies.");

IList<CacheDependencyKey> dependencies = null;
if (SystemManager.CurrentHttpContext.Items.Contains(PageCacheDependencyKeys.PageData))
{
dependencies = SystemManager.CurrentHttpContext.Items[PageCacheDependencyKeys.PageData] as IList<CacheDependencyKey>;
}
string widgetId = controller.ViewData[Telerik.Sitefinity.Mvc.ControllerActionInvoker.ControlDataIdKey] as string;

if (dependencies == null)
{
dependencies = new List<CacheDependencyKey>();
SystemManager.CurrentHttpContext.Items.Add(PageCacheDependencyKeys.PageData, dependencies);
}

foreach (var key in keys)
dependencies.Add(key);
httpContext.AddCacheDependencies(keys, widgetId);
}

/// <summary>
Expand Down Expand Up @@ -208,7 +198,7 @@ public static string GetCurrentPageUrl(this IController controller)
/// </summary>
/// <param name="controller">The controller.</param>
/// <returns>The dynamic module type.</returns>
public static DynamicModuleType GetDynamicContentType(this ControllerBase controller)
public static IDynamicModuleType GetDynamicContentType(this ControllerBase controller)
{
if (controller == null)
throw new ArgumentNullException("controller");
Expand All @@ -228,7 +218,7 @@ public static DynamicModuleType GetDynamicContentType(this ControllerBase contro
/// <returns>
/// The dynamic module type.
/// </returns>
public static DynamicModuleType GetDynamicContentType(this ControllerBase controller, string controllerName)
public static IDynamicModuleType GetDynamicContentType(this ControllerBase controller, string controllerName)
{
if (controller == null)
throw new ArgumentNullException("controller");
Expand All @@ -248,7 +238,7 @@ public static DynamicModuleType GetDynamicContentType(this ControllerBase contro
/// <returns>
/// The dynamic module type.
/// </returns>
public static DynamicModuleType GetDynamicContentType(string controllerName)
public static IDynamicModuleType GetDynamicContentType(string controllerName)
{
return ControllerExtensions.GetDynamicContentType(controllerName, null);
}
Expand All @@ -261,7 +251,7 @@ public static DynamicModuleType GetDynamicContentType(string controllerName)
/// <returns>
/// The dynamic module type.
/// </returns>
public static DynamicModuleType GetDynamicContentType(string controllerName, string moduleName)
public static IDynamicModuleType GetDynamicContentType(string controllerName, string moduleName)
{
return ControllerExtensions.FindDynamicContentTypes(controllerName, moduleName).FirstOrDefault();
}
Expand Down Expand Up @@ -320,28 +310,23 @@ public static ActionResult HandleInvalidDetailsAction(this IController controlle
/// <returns>
/// The dynamic module types.
/// </returns>
internal static IQueryable<DynamicModuleType> FindDynamicContentTypes(string controllerName, string moduleName)
internal static IEnumerable<IDynamicModuleType> FindDynamicContentTypes(string controllerName, string moduleName)
{
if (controllerName == null)
throw new ArgumentNullException("controllerName");

if (SystemManager.GetModule("ModuleBuilder") == null)
return Enumerable.Empty<DynamicModuleType>().AsQueryable();

// TODO: use ModuleBuilderManager.GetModules()
var moduleProvider = ModuleBuilderManager.GetManager().Provider;
var dynamicModuleTypes = ModuleBuilderManager.GetActiveTypes()
.Where(t => string.Equals(t.TypeName, controllerName, StringComparison.OrdinalIgnoreCase));

var dynamicModuleTypes = moduleProvider.GetDynamicModuleTypes().Where(t => t.TypeName == controllerName);
if (!moduleName.IsNullOrWhitespace())
{
dynamicModuleTypes = dynamicModuleTypes.Where(t => t.ModuleName == moduleName);
}

var dynamicContentTypes = moduleProvider.GetDynamicModules()
.Where(m => m.Status == DynamicModuleStatus.Active)
.Join(dynamicModuleTypes, m => m.Id, t => t.ParentModuleId, (m, t) => t);

return dynamicContentTypes;
return dynamicModuleTypes;
}

/// <summary>
Expand Down Expand Up @@ -605,12 +590,12 @@ private static IEnumerable<string> GetViews(Controller controller, IEnumerable<s
var viewExtensions = ControllerExtensions.GetViewFileExtensions(controller);
var widgetName = controller.RouteData != null ? controller.RouteData.Values["widgetName"] as string : null;

var baseFiles = ControllerExtensions.GetViewsForAssembly(controller.GetType().Assembly, viewLocations, viewExtensions,
var baseFiles = ControllerExtensions.GetViewsForAssembly(controller.GetType().Assembly, viewLocations, viewExtensions,
ref viewFilesMappings, moduleName);
if (!widgetName.IsNullOrEmpty())
{
var widgetAssembly = FrontendManager.ControllerFactory.ResolveControllerType(widgetName).Assembly;
var widgetFiles = ControllerExtensions.GetViewsForAssembly(widgetAssembly, viewLocations, viewExtensions,
var widgetFiles = ControllerExtensions.GetViewsForAssembly(widgetAssembly, viewLocations, viewExtensions,
ref viewFilesMappings, moduleName);
return baseFiles.Union(widgetFiles);
}
Expand All @@ -626,7 +611,7 @@ private static IEnumerable<string> GetViewsForAssembly(Assembly assembly, IEnume
.Distinct();
}

private static IEnumerable<string> GetViewsForAssembly(Assembly assembly, IEnumerable<string> viewLocations, IEnumerable<string> viewExtensions,
private static IEnumerable<string> GetViewsForAssembly(Assembly assembly, IEnumerable<string> viewLocations, IEnumerable<string> viewExtensions,
ref Dictionary<string, string> viewFilesMappings, string moduleName = null)
{
var pathDef = FrontendManager.VirtualPathBuilder.GetPathDefinition(assembly, moduleName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public DetailActionParamsMapper(ControllerBase controller, Type itemType, Func<s
}
}

private bool TryMatchUrl(string[] urlParams, RequestContext requestContext, bool setUrlParametersResolved)
private bool TryMatchUrl(string[] urlParams, RequestContext requestContext, bool setUrlParametersResolved, bool setToContext = true)
{
if (urlParams == null || urlParams.Length == 0 || !this.IsDetailsModeSupported())
return false;
Expand All @@ -91,15 +91,16 @@ private bool TryMatchUrl(string[] urlParams, RequestContext requestContext, bool

if (item != null && this.CanDisplayItem(item))
{
SystemManager.CurrentHttpContext.Items["detailItem"] = item;
if(setToContext)
SystemManager.CurrentHttpContext.Items["detailItem"] = item;

this.AddContentItemToRouteData(requestContext, redirectUrl, item, setUrlParametersResolved);

return true;
}
else if (this.showDetailsViewOnChildDetailsView)
{
return this.TryMatchUrl(urlParams.Take(urlParams.Length - 1).ToArray(), requestContext, setUrlParametersResolved);
return this.TryMatchUrl(urlParams.Take(urlParams.Length - 1).ToArray(), requestContext, setUrlParametersResolved, false);
}

return false;
Expand Down
3 changes: 3 additions & 0 deletions Telerik.Sitefinity.Frontend/Mvc/Models/ContentModelBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
using Telerik.Sitefinity.Modules;
using Telerik.Sitefinity.RelatedData;
using Telerik.Sitefinity.Services;
using Telerik.Sitefinity.Taxonomies;
using Telerik.Sitefinity.Taxonomies.Model;
using Telerik.Sitefinity.Web.Model;
using Telerik.Sitefinity.Web.UI.ContentUI.Enums;
Expand Down Expand Up @@ -528,6 +529,8 @@ protected virtual IEnumerable<ItemViewModel> ApplyListSettings(int page, IQuerya
var queryResult = this.FetchItems(query);
queryResult.SetRelatedDataSourceContext();

TaxonomyApplicationState.SetTaxonomyDataSourceContext(queryResult);

foreach (var item in queryResult)
{
result.Add(this.CreateItemViewModelInstance(item));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
using System.Dynamic;
using System.Linq;
using Newtonsoft.Json;
using Telerik.OpenAccess.Metadata;
using Telerik.Sitefinity.Abstractions;
using Telerik.Sitefinity.Descriptors;
using Telerik.Sitefinity.DynamicModules.Model;
using Telerik.Sitefinity.Model;
using Telerik.Sitefinity.Modules;
using Telerik.Sitefinity.Modules.GenericContent;
Expand All @@ -26,6 +28,11 @@ public DynamicDataItemFieldAccessor(ItemViewModel itemViewModel)
: base()
{
this.item = itemViewModel;

if (this.item.DataItem is IDeferredHtmlFilterContainer deferredFilterContainer)
{
deferredFilterContainer.MarkForDefferedFiltering();
}
}

/// <summary>
Expand Down Expand Up @@ -67,7 +74,11 @@ public object GetMemberValue(string fieldName)
if(fieldType == UserFriendlyDataType.LongText)
{
var stringValue = this.GetAppropriateStringValue(value);
return HtmlFilterProvider.ApplyFilters(stringValue);
if (!(this.item.DataItem is IDeferredHtmlFilterContainer))
{
stringValue = HtmlFilterProvider.ApplyFilters(stringValue);
}
return stringValue;
}
else if(fieldType == UserFriendlyDataType.Link)
{
Expand Down
Loading

0 comments on commit 5e64014

Please sign in to comment.