Merge branch 'dev' into issue/8773

This commit is contained in:
Benedek Farkas 2024-04-17 10:26:53 +02:00
commit 7b07ab9b3b
3 changed files with 33 additions and 24 deletions

View File

@ -1,26 +1,26 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.Mvc;
using System.Web.Routing;
using Orchard.ContentManagement;
using Orchard.ContentManagement.Aspects;
using Orchard.ContentManagement.Handlers;
using Orchard.Core.Contents.Settings;
using Orchard.Core.Navigation.Models;
using Orchard.Core.Navigation.Services;
using Orchard.Core.Navigation.ViewModels;
using Orchard.Localization;
using Orchard.Mvc.Extensions;
using Orchard.UI;
using Orchard.UI.Notify;
using Orchard.UI.Navigation;
using Orchard.Utility;
using System;
using Orchard.ContentManagement.Handlers;
using Orchard.Logging;
using Orchard.Exceptions;
using Orchard.ContentManagement.Aspects;
using Orchard.Utility.Extensions;
using Orchard.Mvc.Html;
using Orchard.Core.Contents.Settings;
using Orchard.Data;
using System.Web.Routing;
using Orchard.Exceptions;
using Orchard.Localization;
using Orchard.Logging;
using Orchard.Mvc.Extensions;
using Orchard.Mvc.Html;
using Orchard.UI;
using Orchard.UI.Navigation;
using Orchard.UI.Notify;
using Orchard.Utility;
using Orchard.Utility.Extensions;
namespace Orchard.Core.Navigation.Controllers {
[ValidateInput(false)]
@ -249,13 +249,14 @@ namespace Orchard.Core.Navigation.Controllers {
}
[HttpPost, ActionName("Edit")]
[Mvc.FormValueRequired("submit.Save")]
[Mvc.FormValueRequired("submit.Publish")]
public ActionResult EditPOST(int id, string returnUrl) {
return EditPOST(id, returnUrl, contentItem => {
if (!contentItem.Has<IPublishingControlAspect>() && !contentItem.TypeDefinition.Settings.GetModel<ContentTypeSettings>().Draftable)
_contentManager.Publish(contentItem);
});
}
private ActionResult EditPOST(int id, string returnUrl, Action<ContentItem> conditionallyPublish) {
var contentItem = _contentManager.Get(id, VersionOptions.DraftRequired);

View File

@ -40,7 +40,8 @@
taxonomyFieldName: '@Model.FieldName',
contentId: @Model.Id,
culture: culture,
selectedValues: selectedValues,
selectedValues: selectedValues
},
success: function (html) {
var container = $(".taxonomy-wrapper[data-id-prefix='@Taxonomyprefix']");
@ -211,3 +212,4 @@
</script>
}
}

View File

@ -167,7 +167,7 @@ namespace Orchard.Data {
}
}
// rebuild query
for(int i = 0; i < affectedCaptures.Count; i++) {
for (int i = 0; i < affectedCaptures.Count; i++) {
var inner = affectedCaptures[i];
for (int j = i + 1; j < affectedCaptures.Count; j++) {
var outer = affectedCaptures[j];
@ -240,13 +240,19 @@ namespace Orchard.Data {
if (tableIndex == fromIndex + 1
|| parts[tableIndex - 1].Equals(",")) {
if (parts[tableIndex + 1].Equals("where", StringComparison.OrdinalIgnoreCase)) {
// There is no alias in the query, so we add "WITH(NOLOCK)" immediately after table name but before the "where" clause.
parts.Insert(tableIndex + 1, "WITH(NOLOCK)");
} else {
// We add "WITH(NOLOCK)" after the table alias.
parts.Insert(tableIndex + 2, "WITH(NOLOCK)");
}
} else {
// probably doing a join, so edit the next "on" and make it
// "WITH (NOLOCK) on"
for (int i = tableIndex + 1; i < whereIndex; i++) {
if (parts[i].Trim().Equals("WITH(NOLOCK)", StringComparison.OrdinalIgnoreCase)) {
// we processed this table anme already
// we processed this table name already.
break;
}
if (parts[i].Trim().Equals("on", StringComparison.OrdinalIgnoreCase)) {