mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-12-03 12:03:51 +08:00
Fixing a "null" slug suggestion bug
- When the title was empty, null was suggested --HG-- branch : dev
This commit is contained in:
@@ -14,7 +14,7 @@ namespace Orchard.Core.Common.Controllers {
|
|||||||
|
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public ActionResult Slugify(string contentType, int? id, int? containerId) {
|
public ActionResult Slugify(string contentType, int? id, int? containerId) {
|
||||||
var slug = "";
|
const string slug = "";
|
||||||
ContentItem contentItem = null;
|
ContentItem contentItem = null;
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(contentType))
|
if (string.IsNullOrEmpty(contentType))
|
||||||
@@ -33,7 +33,7 @@ namespace Orchard.Core.Common.Controllers {
|
|||||||
|
|
||||||
_contentManager.UpdateEditorModel(contentItem, this);
|
_contentManager.UpdateEditorModel(contentItem, this);
|
||||||
|
|
||||||
return Json(contentItem.As<RoutableAspect>().Slug);
|
return Json(contentItem.As<RoutableAspect>().Slug ?? slug);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IUpdateModel.TryUpdateModel<TModel>(TModel model, string prefix, string[] includeProperties, string[] excludeProperties) {
|
bool IUpdateModel.TryUpdateModel<TModel>(TModel model, string prefix, string[] includeProperties, string[] excludeProperties) {
|
||||||
|
|||||||
Reference in New Issue
Block a user