diff --git a/.github/workflows/compile.yml b/.github/workflows/compile.yml index c8a38d39a..b5a4b2945 100644 --- a/.github/workflows/compile.yml +++ b/.github/workflows/compile.yml @@ -27,11 +27,33 @@ jobs: uses: microsoft/setup-msbuild@v2 - name: Compile - run: msbuild Orchard.proj /m /v:minimal /t:Compile /p:MvcBuildViews=true /p:TreatWarningsAsErrors=true -WarnAsError + run: msbuild Orchard.proj /m /v:minimal /t:Compile /p:TreatWarningsAsErrors=true -WarnAsError /p:MvcBuildViews=true - name: Test run: msbuild Orchard.proj /m /v:minimal /t:Test + - name: Run Orchard setup + run: | + $commandFile = 'src/Orchard.Web/bin/setup-commands.txt' + New-Item -Path $commandFile -ItemType File -Force + Set-Content -Path $commandFile -Value 'setup /SiteName:Orchard /AdminUsername:admin /AdminPassword:Password1! /DatabaseProvider:SqlCe /Recipe:Default' + & 'src/Orchard.Web/bin/Orchard.exe' @$commandFile + + - name: Run code generation + run: | + $commandFile = 'src/Orchard.Web/bin/codegen-commands.txt' + New-Item -Path $commandFile -ItemType File -Force + Set-Content -Path $commandFile -Value @' + feature enable Orchard.CodeGeneration + codegen module Orchard.CodeGeneration.TestModule + codegen theme Orchard.CodeGeneration.TestTheme /CreateProject:true + codegen moduletests Orchard.CodeGeneration.TestModule + '@ + & 'src/Orchard.Web/bin/Orchard.exe' @$commandFile + + - name: Compile with generated projects + run: msbuild Orchard.proj /m /v:minimal /t:Compile /p:TreatWarningsAsErrors=true -WarnAsError /NoWarn:CS2008 + compile-node: name: Compile client-side assets defaults: diff --git a/CREDITS.txt b/CREDITS.txt index 216e1d712..dac054a0f 100644 --- a/CREDITS.txt +++ b/CREDITS.txt @@ -52,12 +52,6 @@ Website: http://dlr.codeplex.com Copyright: Copyright (c) Microsoft Corporation License: Apache Software Foundation License 2.0 -DotNetZip ------ -Website: http://dotnetzip.codeplex.com/ -Copyright: -License: MS-PL - Eric Meyer's Reset CSS ----- Website: http://meyerweb.com/eric/tools/css/reset/ diff --git a/README.md b/README.md index 5a7073d25..19d04cb9e 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,14 @@ # Orchard -Orchard is a free, open source, community-focused Content Management System built on the ASP.NET MVC platform. +Orchard is a free, open source, community-focused Content Management System built on the ASP.NET MVC platform. You are looking at Orchard 1, the older, .NET Framework-based version that has been in development since 2009. -[![Join the chat at https://gitter.im/OrchardCMS/Orchard](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/OrchardCMS/Orchard?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) +If you're starting a new project (or maintaining a project built on Orchard 1), you should check out [Orchard Core](https://github.com/OrchardCMS/OrchardCore), the new generation of Orchard built on ASP.NET Core. You can also try it for free on [DotNest.com](https://dotnest.com)! -You can try it for free on [DotNest.com](https://dotnest.com) or on Microsoft Azure by clicking on this button. - -[![Deploy to Azure](https://azuredeploy.net/deploybutton.png)](https://portal.azure.com/#create/OutercurveFoundation.OrchardCMS) +Join the community discussion on [Discord](https://orchardcore.net/discord), where we also have a [channel dedicated to Orchard 1](https://discord.com/channels/551136772243980291/551137194689953848). ## About The Orchard Project -#### Please visit our website at https://orchardproject.net for the most current information about this project. +#### Please visit our website at https://orchardcore.net for the most current information about this project. Orchard is a free, open source, community-focused **Content Management System** built on the ASP.NET MVC platform. @@ -24,12 +22,12 @@ Our mission is to empower our users and foster a dedicated and diverse community Orchard is currently in version **[1.10.3](https://github.com/OrchardCMS/Orchard/releases/tag/1.10.3)**: It contains bugfixes and the more impactful changes and new features added in the latest major version (*1.10*). -We invite participation by the developer community in shaping the project’s direction, so that we can publicly validate our designs and development approach. +We invite participation by the developer community in shaping the project's direction, so that we can publicly validate our designs and development approach. All our releases are available on our [Releases](https://github.com/OrchardCMS/Orchard/releases) page, and we encourage interested developers to check out the source code on the Orchard GitHub site and get involved with the project. * [Download the latest release](https://github.com/OrchardCMS/Orchard/releases) -* [Feature roadmap](https://docs.orchardproject.net/en/latest/Documentation/Feature-roadmap/) -* [Docs and designs/specs](https://docs.orchardproject.net) +* [Feature roadmap](https://docs.orchardcore.net/projects/O1/en/latest/Documentation/Feature-roadmap/) +* [Docs and designs/specs](https://docs.orchardcore.net/projects/O1/en/latest/) ## How To Get Involved @@ -42,11 +40,7 @@ There are many ways you can contribute to Orchard: * [Find and file a bug](https://github.com/OrchardCMS/Orchard/issues) * [Propose a feature idea](https://github.com/OrchardCMS/Orchard/issues/new) * [Ask and answer questions on Stack Overflow](https://stackoverflow.com/questions/tagged/orchardcms) -* [Participate in our gitter.im chatroom](https://gitter.im/OrchardCMS/Orchard) -* [Submit a pull request](https://docs.orchardproject.net/en/latest/Documentation/Contributing-patches/) +* [Join us on Discord](https://orchardcore.net/discord) +* [Submit a pull request](https://docs.orchardcore.net/projects/O1/en/latest/Documentation/Contributing-patches/) * [Translate Orchard](https://crowdin.com/project/orchard-cms) -* [Contribute modules and themes to our gallery](https://gallery.orchardproject.net/) - -## The Future Of Orchard CMS: Orchard Core - -As the underlying frameworks (.NET, ASP.NET and ASP.NET MVC) are constantly evolving, Orchard of course keeps track of the changes and improvements of these: Orchard Core is the next generation of Orchard releases that is based on [ASP.NET Core](https://www.asp.net/core). Just like the current Orchard project, it's fully [open-source and is publicly available on GitHub](https://github.com/OrchardCMS/OrchardCore). Orchard Core (as a framework) is being built from scratch: it's still in development and does not share any of its code base (at least directly) with the current versions (1.x) of Orchard. +* [Contribute modules and themes to our gallery](https://gallery.orchardproject.net) diff --git a/src/Orchard.Specs/App.Config b/src/Orchard.Specs/App.Config index 05fd3dbfc..2805ca3df 100644 --- a/src/Orchard.Specs/App.Config +++ b/src/Orchard.Specs/App.Config @@ -42,6 +42,14 @@ + + + + + + + + diff --git a/src/Orchard.Tests.Modules/Media/Services/MediaServiceTests.cs b/src/Orchard.Tests.Modules/Media/Services/MediaServiceTests.cs index 018772b6f..e349829dd 100644 --- a/src/Orchard.Tests.Modules/Media/Services/MediaServiceTests.cs +++ b/src/Orchard.Tests.Modules/Media/Services/MediaServiceTests.cs @@ -1,8 +1,8 @@ using System; using System.Collections.Generic; using System.IO; +using System.IO.Compression; using System.Linq; -using Ionic.Zip; using NUnit.Framework; using Orchard.Environment.Configuration; using Orchard.FileSystems.Media; @@ -53,10 +53,10 @@ namespace Orchard.Tests.Modules.Media.Services { [Test] public void GetMediaFoldersTest() { StorageProvider.ListFoldersPredicate = path => { - return string.IsNullOrEmpty(path) ? new[] {new StubStorageFolder(FolderName1)} - : string.Equals(path, FolderName1) ? new[] {new StubStorageFolder(FolderName2), new StubStorageFolder(FolderName3)} + return string.IsNullOrEmpty(path) ? new[] { new StubStorageFolder(FolderName1) } + : string.Equals(path, FolderName1) ? new[] { new StubStorageFolder(FolderName2), new StubStorageFolder(FolderName3) } : new StubStorageFolder[] { }; - }; + }; IEnumerable mediaFolders = MediaService.GetMediaFolders(null); Assert.That(mediaFolders.Count(), Is.EqualTo(1), "Root path only has 1 sub directory"); @@ -94,7 +94,7 @@ namespace Orchard.Tests.Modules.Media.Services { Assert.That(StorageProvider.SavedStreams.Contains(StorageProvider.Combine(FolderName1, FinalDottedWebconfigFileName)), Is.False, "no extension files are never allowed"); Assert.That(StorageProvider.SavedStreams.Contains(StorageProvider.Combine(FolderName1, PaddedWebconfigFileName)), Is.False, "no extension files are never allowed"); Assert.That(StorageProvider.SavedStreams.Contains(StorageProvider.Combine(FolderName1, FinalDottedTextFileName)), Is.False, "no extension files are never allowed"); - + Assert.That(StorageProvider.SavedStreams.Count, Is.EqualTo(3)); } @@ -160,29 +160,30 @@ namespace Orchard.Tests.Modules.Media.Services { } private MemoryStream CreateZipMemoryStream() { + var entries = new List { + TextFileName, WebconfigFileName, DllFileName, ZipFileName, NoExtensionFileName, PaddedWebconfigFileName, + FinalDottedWebconfigFileName, PaddedTextFileName, FinalDottedTextFileName + }; + // Setup memory stream with zip archive for more complex scenarios MemoryStream memoryStream = new MemoryStream(); - using (ZipFile zipOut = new ZipFile()) { - - zipOut.AddEntry(TextFileName, new byte[] { 0x01 }); - zipOut.AddEntry(WebconfigFileName, new byte[] { 0x02 }); - zipOut.AddEntry(DllFileName, new byte[] { 0x03 }); - zipOut.AddEntry(ZipFileName, new byte[] { 0x04 }); - zipOut.AddEntry(NoExtensionFileName, new byte[] { 0x05 }); - zipOut.AddEntry(PaddedWebconfigFileName, new byte[] { 0x06 }); - zipOut.AddEntry(FinalDottedWebconfigFileName, new byte[] { 0x07 }); - zipOut.AddEntry(PaddedTextFileName, new byte[] { 0x08 }); - zipOut.AddEntry(FinalDottedTextFileName, new byte[] { 0x09 }); - - zipOut.Save(memoryStream); + using (var archive = new ZipArchive(memoryStream, ZipArchiveMode.Create, leaveOpen: true)) { + var content = new byte[] { 0x01 }; + foreach (var entry in entries) { + var zipEntry = archive.CreateEntry(entry); + using (var zipStream = zipEntry.Open()) { + zipStream.Write(content, 0, 1); + } + ++content[0]; + } } - + return new MemoryStream(memoryStream.ToArray()); } private class MediaServiceAccessor : MediaService { public MediaServiceAccessor(IStorageProvider storageProvider, IOrchardServices orchardServices) - : base (storageProvider, orchardServices) {} + : base(storageProvider, orchardServices) { } public void UnzipMediaFileArchiveAccessor(string targetFolder, Stream zipStream) { UnzipMediaFileArchive(targetFolder, zipStream); diff --git a/src/Orchard.Tests.Modules/Orchard.Tests.Modules.csproj b/src/Orchard.Tests.Modules/Orchard.Tests.Modules.csproj index 739f04057..587e740e8 100644 --- a/src/Orchard.Tests.Modules/Orchard.Tests.Modules.csproj +++ b/src/Orchard.Tests.Modules/Orchard.Tests.Modules.csproj @@ -67,9 +67,6 @@ ..\packages\Castle.Core.3.3.1\lib\net45\Castle.Core.dll - - ..\packages\DotNetZip.1.12.0\lib\net20\DotNetZip.dll - ..\packages\FluentNHibernate.3.1.0\lib\net461\FluentNHibernate.dll @@ -141,6 +138,7 @@ ..\..\lib\sqlce\System.Data.SqlServerCe.dll True + diff --git a/src/Orchard.Tests.Modules/packages.config b/src/Orchard.Tests.Modules/packages.config index 8761f11fd..66b17f5e3 100644 --- a/src/Orchard.Tests.Modules/packages.config +++ b/src/Orchard.Tests.Modules/packages.config @@ -3,7 +3,6 @@ - @@ -13,7 +12,7 @@ - + diff --git a/src/Orchard.Tests/Orchard.Framework.Tests.csproj b/src/Orchard.Tests/Orchard.Framework.Tests.csproj index bb4fb0a0b..a0364e355 100644 --- a/src/Orchard.Tests/Orchard.Framework.Tests.csproj +++ b/src/Orchard.Tests/Orchard.Framework.Tests.csproj @@ -108,7 +108,7 @@ ..\packages\Moq.4.2.1510.2205\lib\net40\Moq.dll - ..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll + ..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll ..\packages\NHibernate.5.5.2\lib\net48\NHibernate.dll diff --git a/src/Orchard.Tests/packages.config b/src/Orchard.Tests/packages.config index 6ee2a3051..0ad04f25e 100644 --- a/src/Orchard.Tests/packages.config +++ b/src/Orchard.Tests/packages.config @@ -15,7 +15,7 @@ - + diff --git a/src/Orchard.Web.Tests/app.config b/src/Orchard.Web.Tests/app.config index 852be14ac..6b5c5dcfb 100644 --- a/src/Orchard.Web.Tests/app.config +++ b/src/Orchard.Web.Tests/app.config @@ -34,6 +34,14 @@ + + + + + + + + diff --git a/src/Orchard.Web/Core/Navigation/Controllers/AdminController.cs b/src/Orchard.Web/Core/Navigation/Controllers/AdminController.cs index 317caed2c..cdd79e4ef 100644 --- a/src/Orchard.Web/Core/Navigation/Controllers/AdminController.cs +++ b/src/Orchard.Web/Core/Navigation/Controllers/AdminController.cs @@ -2,7 +2,6 @@ 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; @@ -16,6 +15,7 @@ using Orchard.Localization; using Orchard.Logging; using Orchard.Mvc.Extensions; using Orchard.Mvc.Html; +using Orchard.Security; using Orchard.UI; using Orchard.UI.Navigation; using Orchard.UI.Notify; @@ -25,50 +25,50 @@ using Orchard.Utility.Extensions; namespace Orchard.Core.Navigation.Controllers { [ValidateInput(false)] public class AdminController : Controller, IUpdateModel { + private readonly IContentManager _contentManager; + private readonly ITransactionManager _transactionManager; + private readonly IAuthorizer _authorizer; + private readonly INotifier _notifier; private readonly IMenuService _menuService; private readonly INavigationManager _navigationManager; private readonly IEnumerable _handlers; private readonly IMenuManager _menuManager; - private readonly IContentManager _contentManager; - private readonly ITransactionManager _transactionManager; public AdminController( IOrchardServices orchardServices, - IContentManager contentManager, - ITransactionManager transactionManager, IMenuService menuService, IMenuManager menuManager, INavigationManager navigationManager, IEnumerable handlers) { - _contentManager = contentManager; - _transactionManager = transactionManager; + _contentManager = orchardServices.ContentManager; + _transactionManager = orchardServices.TransactionManager; + _authorizer = orchardServices.Authorizer; + _notifier = orchardServices.Notifier; _menuService = menuService; _menuManager = menuManager; _navigationManager = navigationManager; _handlers = handlers; - Services = orchardServices; T = NullLocalizer.Instance; Logger = NullLogger.Instance; } public Localizer T { get; set; } public ILogger Logger { get; set; } - public IOrchardServices Services { get; set; } public ActionResult Index(NavigationManagementViewModel model, int? menuId) { - var menus = Services.ContentManager.Query("Menu").List().ToList() + var menus = _contentManager.Query("Menu").List().ToList() .OrderBy(x => x.ContentManager.GetItemMetadata(x).DisplayText); if (!menus.Any()) { - if (!Services.Authorizer.Authorize(Permissions.ManageMenus, T("Not allowed to manage menus"))) { + if (!_authorizer.Authorize(Permissions.ManageMenus, T("Not allowed to manage menus"))) { return new HttpUnauthorizedResult(); } return RedirectToAction("Create", "Admin", new { area = "Contents", id = "Menu", returnUrl = Request.RawUrl }); } - var allowedMenus = menus.Where(menu => Services.Authorizer.Authorize(Permissions.ManageMenus, menu)).ToList(); + var allowedMenus = menus.Where(menu => _authorizer.Authorize(Permissions.ManageMenus, menu)).ToList(); if (!allowedMenus.Any()) { return new HttpUnauthorizedResult(); @@ -87,7 +87,11 @@ namespace Orchard.Core.Navigation.Controllers { } if (model.MenuItemEntries == null || !model.MenuItemEntries.Any()) { - model.MenuItemEntries = _menuService.GetMenuParts(currentMenu.Id).Select(CreateMenuItemEntries).OrderBy(menuPartEntry => menuPartEntry.Position, new FlatPositionComparer()).ToList(); + model.MenuItemEntries = _menuService + .GetMenuParts(currentMenu.Id) + .Select(CreateMenuItemEntries) + .OrderBy(menuPartEntry => menuPartEntry.Position, new FlatPositionComparer()) + .ToList(); } model.MenuItemDescriptors = _menuManager.GetMenuItemTypes(); @@ -100,7 +104,10 @@ namespace Orchard.Core.Navigation.Controllers { [HttpPost, ActionName("Index")] public ActionResult IndexPOST(IList menuItemEntries, int? menuId) { - if (!Services.Authorizer.Authorize(Permissions.ManageMenus, (menuId.HasValue) ? _menuService.GetMenu(menuId.Value) : null, T("Couldn't manage the main menu"))) + if (!_authorizer.Authorize( + Permissions.ManageMenus, + menuId.HasValue ? _menuService.GetMenu(menuId.Value) : null, + T("Couldn't manage the menu"))) return new HttpUnauthorizedResult(); // See https://github.com/OrchardCMS/Orchard/issues/948 @@ -123,25 +130,15 @@ namespace Orchard.Core.Navigation.Controllers { return RedirectToAction("Index", new { menuId }); } - private MenuItemEntry CreateMenuItemEntries(MenuPart menuPart) { - return new MenuItemEntry { - MenuItemId = menuPart.Id, - IsMenuItem = menuPart.Is(), - Text = menuPart.MenuText, - Position = menuPart.MenuPosition, - Url = menuPart.Is() - ? menuPart.As().Url - : _navigationManager.GetUrl(null, Services.ContentManager.GetItemMetadata(menuPart).DisplayRouteValues), - ContentItem = menuPart.ContentItem, - }; - } - [HttpPost] public ActionResult Delete(int id) { MenuPart menuPart = _menuService.Get(id); int? menuId = null; - if (!Services.Authorizer.Authorize(Permissions.ManageMenus, (menuPart != null) ? _menuService.GetMenu(menuPart.Menu.Id) : null, T("Couldn't manage the main menu"))) + if (!_authorizer.Authorize( + Permissions.ManageMenus, + menuPart == null ? null : _menuService.GetMenu(menuPart.Menu.Id), + T("Couldn't manage the menu"))) return new HttpUnauthorizedResult(); if (menuPart != null) { @@ -155,7 +152,8 @@ namespace Orchard.Core.Navigation.Controllers { foreach (var menuItem in menuItems.Concat(new[] { menuPart })) { // if the menu item is a concrete content item, don't delete it, just unreference the menu - if (!menuPart.ContentItem.TypeDefinition.Settings.ContainsKey("Stereotype") || menuPart.ContentItem.TypeDefinition.Settings["Stereotype"] != "MenuItem") { + if (!menuPart.ContentItem.TypeDefinition.Settings.ContainsKey("Stereotype") + || menuPart.ContentItem.TypeDefinition.Settings["Stereotype"] != "MenuItem") { menuPart.Menu = null; } else { @@ -168,26 +166,18 @@ namespace Orchard.Core.Navigation.Controllers { return RedirectToAction("Index", new { menuId }); } - bool IUpdateModel.TryUpdateModel(TModel model, string prefix, string[] includeProperties, string[] excludeProperties) { - return TryUpdateModel(model, prefix, includeProperties, excludeProperties); - } - - void IUpdateModel.AddModelError(string key, LocalizedString errorMessage) { - ModelState.AddModelError(key, errorMessage.ToString()); - } - public ActionResult CreateMenuItem(string id, int menuId, string returnUrl) { - if (!Services.Authorizer.Authorize(Permissions.ManageMenus, _menuService.GetMenu(menuId), T("Couldn't manage the main menu"))) + if (!_authorizer.Authorize(Permissions.ManageMenus, _menuService.GetMenu(menuId), T("Couldn't manage the menu"))) return new HttpUnauthorizedResult(); // create a new temporary menu item - var menuPart = Services.ContentManager.New(id); + var menuPart = _contentManager.New(id); if (menuPart == null) return HttpNotFound(); // load the menu - var menu = Services.ContentManager.Get(menuId); + var menu = _contentManager.Get(menuId); if (menu == null) return HttpNotFound(); @@ -196,7 +186,7 @@ namespace Orchard.Core.Navigation.Controllers { // filter the content items for this specific menu menuPart.MenuPosition = Position.GetNext(_navigationManager.BuildMenu(menu)); menuPart.Menu = menu; - var model = Services.ContentManager.BuildEditor(menuPart); + var model = _contentManager.BuildEditor(menuPart); return View(model); } @@ -206,32 +196,32 @@ namespace Orchard.Core.Navigation.Controllers { } Logger.Error(T("Creating menu item failed: {0}", exception.Message).Text); - Services.Notifier.Error(T("Creating menu item failed: {0}", exception.Message)); + _notifier.Error(T("Creating menu item failed: {0}", exception.Message)); return this.RedirectLocal(returnUrl, () => RedirectToAction("Index")); } } [HttpPost, ActionName("CreateMenuItem")] public ActionResult CreateMenuItemPost(string id, int menuId, string returnUrl) { - if (!Services.Authorizer.Authorize(Permissions.ManageMenus, _menuService.GetMenu(menuId), T("Couldn't manage the main menu"))) + if (!_authorizer.Authorize(Permissions.ManageMenus, _menuService.GetMenu(menuId), T("Couldn't manage the menu"))) return new HttpUnauthorizedResult(); - var menuPart = Services.ContentManager.New(id); + var menuPart = _contentManager.New(id); if (menuPart == null) return HttpNotFound(); // load the menu - var menu = Services.ContentManager.Get(menuId); + var menu = _contentManager.Get(menuId); if (menu == null) return HttpNotFound(); menuPart.Menu = menu; - var model = Services.ContentManager.UpdateEditor(menuPart, this); + var model = _contentManager.UpdateEditor(menuPart, this); menuPart.MenuPosition = Position.GetNext(_navigationManager.BuildMenu(menu)); - Services.ContentManager.Create(menuPart); + _contentManager.Create(menuPart); if (!ModelState.IsValid) { - Services.TransactionManager.Cancel(); + _transactionManager.Cancel(); return View(model); } - Services.Notifier.Success(T("Your {0} has been added.", menuPart.TypeDefinition.DisplayName)); + _notifier.Success(T("Your {0} has been added.", menuPart.TypeDefinition.DisplayName)); return this.RedirectLocal(returnUrl, () => RedirectToAction("Index")); } @@ -241,7 +231,7 @@ namespace Orchard.Core.Navigation.Controllers { if (contentItem == null) return HttpNotFound(); - if (!Services.Authorizer.Authorize(Permissions.ManageMenus, contentItem.Content.MenuPart.Menu, T("Couldn't manage the main menu"))) + if (!_authorizer.Authorize(Permissions.ManageMenus, contentItem.Content.MenuPart.Menu, T("Couldn't manage the menu"))) return new HttpUnauthorizedResult(); var model = _contentManager.BuildEditor(contentItem); @@ -252,20 +242,81 @@ namespace Orchard.Core.Navigation.Controllers { [Mvc.FormValueRequired("submit.Publish")] public ActionResult EditPOST(int id, string returnUrl) { return EditPOST(id, returnUrl, contentItem => { - if (!contentItem.Has() && !contentItem.TypeDefinition.Settings.GetModel().Draftable) + if (!contentItem.Has() + && !contentItem.TypeDefinition.Settings.GetModel().Draftable + && contentItem.IsPublished()) _contentManager.Publish(contentItem); }); } - private ActionResult EditPOST(int id, string returnUrl, Action conditionallyPublish) { - var contentItem = _contentManager.Get(id, VersionOptions.DraftRequired); - - if (contentItem == null) + [HttpPost] + // Copy of Contents/AdminController/Publish, but with different permission check and redirect. + public ActionResult Publish(int id) { + var menuPart = _contentManager.GetLatest(id); + if (menuPart == null) return HttpNotFound(); - if (!Services.Authorizer.Authorize(Permissions.ManageMenus, contentItem.Content.MenuPart.Menu, T("Couldn't manage the main menu"))) + if (!_authorizer.Authorize(Permissions.ManageMenus, menuPart.Menu, T("Couldn't manage the menu"))) return new HttpUnauthorizedResult(); + _contentManager.Publish(menuPart.ContentItem); + + _notifier.Success( + string.IsNullOrWhiteSpace(menuPart.MenuText) + ? string.IsNullOrWhiteSpace(menuPart.TypeDefinition.DisplayName) + ? T("Your content has been published.") + : T("Your {0} has been published.", menuPart.TypeDefinition.DisplayName) + : T("'{0}' has been published.", menuPart.MenuText)); + + return RedirectToAction("Index", new { menuId = menuPart.Menu.Id }); + } + + [HttpPost] + // Copy of Contents/AdminController/Unpublish, but with different permission check and redirect. + public ActionResult Unpublish(int id) { + var menuPart = _contentManager.GetLatest(id); + if (menuPart == null) + return HttpNotFound(); + + if (!_authorizer.Authorize(Permissions.ManageMenus, menuPart.Menu, T("Couldn't manage the menu"))) + return new HttpUnauthorizedResult(); + + _contentManager.Unpublish(menuPart.ContentItem); + + _notifier.Success( + string.IsNullOrWhiteSpace(menuPart.MenuText) + ? string.IsNullOrWhiteSpace(menuPart.TypeDefinition.DisplayName) + ? T("Your content has been unpublished.") + : T("Your {0} has been unpublished.", menuPart.TypeDefinition.DisplayName) + : T("'{0}' has been unpublished.", menuPart.MenuText)); + + return RedirectToAction("Index", new { menuId = menuPart.Menu.Id }); + } + + private MenuItemEntry CreateMenuItemEntries(MenuPart menuPart) { + return new MenuItemEntry { + MenuItemId = menuPart.Id, + IsMenuItem = menuPart.Is(), + Text = menuPart.MenuText, + Position = menuPart.MenuPosition, + Url = menuPart.Is() + ? menuPart.As().Url + : _navigationManager.GetUrl(null, _contentManager.GetItemMetadata(menuPart).DisplayRouteValues), + ContentItem = menuPart.ContentItem, + }; + } + + private ActionResult EditPOST(int id, string returnUrl, Action conditionallyPublish) { + var menuPart = _contentManager.GetDraftRequired(id); + + if (menuPart == null) + return HttpNotFound(); + + if (!_authorizer.Authorize(Permissions.ManageMenus, menuPart.Menu, T("Couldn't manage the menu"))) + return new HttpUnauthorizedResult(); + + var contentItem = menuPart.ContentItem; + string previousRoute = null; if (contentItem.Has() && !string.IsNullOrWhiteSpace(returnUrl) @@ -290,11 +341,22 @@ namespace Orchard.Core.Navigation.Controllers { returnUrl = Url.ItemDisplayUrl(contentItem); } - Services.Notifier.Information(string.IsNullOrWhiteSpace(contentItem.TypeDefinition.DisplayName) - ? T("Your content has been saved.") - : T("Your {0} has been saved.", contentItem.TypeDefinition.DisplayName)); + _notifier.Success( + string.IsNullOrWhiteSpace(menuPart.MenuText) + ? string.IsNullOrWhiteSpace(contentItem.TypeDefinition.DisplayName) + ? T("Your content has been saved.") + : T("Your {0} has been saved.", contentItem.TypeDefinition.DisplayName) + : T("'{0}' has been saved.", menuPart.MenuText)); - return this.RedirectLocal(returnUrl, () => RedirectToAction("Edit", new RouteValueDictionary { { "Id", contentItem.Id } })); + return RedirectToAction("Index", new { menuId = menuPart.Menu.Id }); + } + + bool IUpdateModel.TryUpdateModel(TModel model, string prefix, string[] includeProperties, string[] excludeProperties) { + return TryUpdateModel(model, prefix, includeProperties, excludeProperties); + } + + void IUpdateModel.AddModelError(string key, LocalizedString errorMessage) { + ModelState.AddModelError(key, errorMessage.ToString()); } } } diff --git a/src/Orchard.Web/Core/Navigation/Services/MainMenuService.cs b/src/Orchard.Web/Core/Navigation/Services/MainMenuService.cs index ea3f94b2f..24fe9f8d5 100644 --- a/src/Orchard.Web/Core/Navigation/Services/MainMenuService.cs +++ b/src/Orchard.Web/Core/Navigation/Services/MainMenuService.cs @@ -19,13 +19,13 @@ namespace Orchard.Core.Navigation.Services { public IEnumerable GetMenuParts(int menuId) { return _contentManager - .Query() - .Where( x => x.MenuId == menuId) + .Query(VersionOptions.Latest) + .Where(x => x.MenuId == menuId) .List(); } public IContent GetMenu(string menuName) { - if(string.IsNullOrWhiteSpace(menuName)) { + if (string.IsNullOrWhiteSpace(menuName)) { return null; } @@ -37,7 +37,7 @@ namespace Orchard.Core.Navigation.Services { } public IContent GetMenu(int menuId) { - return _contentManager.Get(menuId, VersionOptions.Published); + return _contentManager.Get(menuId, VersionOptions.Published); } public MenuPart Get(int menuPartId) { @@ -45,11 +45,11 @@ namespace Orchard.Core.Navigation.Services { } public IContent Create(string name) { - - if(string.IsNullOrWhiteSpace(name)) { + + if (string.IsNullOrWhiteSpace(name)) { throw new ArgumentNullException(name); } - + var menu = _contentManager.Create("Menu"); menu.As().Title = name; diff --git a/src/Orchard.Web/Core/Navigation/Views/Admin/Index.cshtml b/src/Orchard.Web/Core/Navigation/Views/Admin/Index.cshtml index 04446adcb..bf969e405 100644 --- a/src/Orchard.Web/Core/Navigation/Views/Admin/Index.cshtml +++ b/src/Orchard.Web/Core/Navigation/Views/Admin/Index.cshtml @@ -1,4 +1,6 @@ @model NavigationManagementViewModel + +@using Orchard.ContentManagement; @using Orchard.Core.Navigation.ViewModels; @using Orchard.Utility.Extensions; @@ -116,11 +118,24 @@ for (int i = index; i < Model.MenuItemEntries.Count; i++) { + + @{ + var menuItemHasPublished = menuPartEntry.ContentItem.HasPublished(); + } + + @Html.Link( + menuItemHasPublished ? T("Unpublish").Text : T("Publish").Text, + Url.Action( + menuItemHasPublished ? "Unpublish": "Publish", + "Admin", + new { area = "Navigation", id = menuPartEntry.ContentItem.Id }), + new { itemprop = "UnsafeUrl" }) + @Html.ItemEditLink(T("Edit").Text, menuPartEntry.ContentItem, new { returnUrl = Request.RawUrl }) - @Html.Link(T("Delete").Text, Url.ItemRemoveUrl(menuPartEntry.ContentItem,null), new { itemprop = "RemoveUrl UnsafeUrl" }) + @Html.Link(T("Delete").Text, Url.ItemRemoveUrl(menuPartEntry.ContentItem, null), new { itemprop = "RemoveUrl UnsafeUrl" }) diff --git a/src/Orchard.Web/Core/Web.config b/src/Orchard.Web/Core/Web.config index c87ba8fa2..4a7c73b04 100644 --- a/src/Orchard.Web/Core/Web.config +++ b/src/Orchard.Web/Core/Web.config @@ -55,7 +55,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.AntiSpam/Orchard.AntiSpam.csproj b/src/Orchard.Web/Modules/Orchard.AntiSpam/Orchard.AntiSpam.csproj index ebd015db4..56a43eda4 100644 --- a/src/Orchard.Web/Modules/Orchard.AntiSpam/Orchard.AntiSpam.csproj +++ b/src/Orchard.Web/Modules/Orchard.AntiSpam/Orchard.AntiSpam.csproj @@ -60,7 +60,7 @@ ..\..\..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll - ..\..\..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll + ..\..\..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll @@ -250,4 +250,4 @@ - + \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.AntiSpam/packages.config b/src/Orchard.Web/Modules/Orchard.AntiSpam/packages.config index d8ef6eca5..4edd53141 100644 --- a/src/Orchard.Web/Modules/Orchard.AntiSpam/packages.config +++ b/src/Orchard.Web/Modules/Orchard.AntiSpam/packages.config @@ -5,5 +5,5 @@ - - + + \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.AuditTrail/Orchard.AuditTrail.csproj b/src/Orchard.Web/Modules/Orchard.AuditTrail/Orchard.AuditTrail.csproj index 1a7ed2921..48fdf1c08 100644 --- a/src/Orchard.Web/Modules/Orchard.AuditTrail/Orchard.AuditTrail.csproj +++ b/src/Orchard.Web/Modules/Orchard.AuditTrail/Orchard.AuditTrail.csproj @@ -65,7 +65,7 @@ ..\..\..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll - ..\..\..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll + ..\..\..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll ..\..\..\packages\NHibernate.5.5.2\lib\net48\NHibernate.dll diff --git a/src/Orchard.Web/Modules/Orchard.AuditTrail/packages.config b/src/Orchard.Web/Modules/Orchard.AuditTrail/packages.config index 78064ba38..e36af329c 100644 --- a/src/Orchard.Web/Modules/Orchard.AuditTrail/packages.config +++ b/src/Orchard.Web/Modules/Orchard.AuditTrail/packages.config @@ -7,7 +7,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.Azure.MediaServices/Orchard.Azure.MediaServices.csproj b/src/Orchard.Web/Modules/Orchard.Azure.MediaServices/Orchard.Azure.MediaServices.csproj index 1dadbf912..19b9cf551 100644 --- a/src/Orchard.Web/Modules/Orchard.Azure.MediaServices/Orchard.Azure.MediaServices.csproj +++ b/src/Orchard.Web/Modules/Orchard.Azure.MediaServices/Orchard.Azure.MediaServices.csproj @@ -113,7 +113,7 @@ ..\..\..\packages\WindowsAzure.Storage.5.0.2\lib\net40\Microsoft.WindowsAzure.Storage.dll - ..\..\..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll + ..\..\..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll ..\..\..\packages\NHibernate.5.5.2\lib\net48\NHibernate.dll diff --git a/src/Orchard.Web/Modules/Orchard.Azure.MediaServices/packages.config b/src/Orchard.Web/Modules/Orchard.Azure.MediaServices/packages.config index b6e0e3c00..b6de14f77 100644 --- a/src/Orchard.Web/Modules/Orchard.Azure.MediaServices/packages.config +++ b/src/Orchard.Web/Modules/Orchard.Azure.MediaServices/packages.config @@ -17,7 +17,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.Azure/Orchard.Azure.csproj b/src/Orchard.Web/Modules/Orchard.Azure/Orchard.Azure.csproj index b6e406e94..edd5be1a8 100644 --- a/src/Orchard.Web/Modules/Orchard.Azure/Orchard.Azure.csproj +++ b/src/Orchard.Web/Modules/Orchard.Azure/Orchard.Azure.csproj @@ -105,7 +105,7 @@ ..\..\..\packages\Microsoft.WindowsAzure.Caching.2.4.0.0\lib\net40-full\Microsoft.WindowsFabric.Data.Common.dll - ..\..\..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll + ..\..\..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll ..\..\..\packages\NHibernate.5.5.2\lib\net48\NHibernate.dll diff --git a/src/Orchard.Web/Modules/Orchard.Azure/packages.config b/src/Orchard.Web/Modules/Orchard.Azure/packages.config index 74217dd57..0ec6e4617 100644 --- a/src/Orchard.Web/Modules/Orchard.Azure/packages.config +++ b/src/Orchard.Web/Modules/Orchard.Azure/packages.config @@ -13,7 +13,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.CodeGeneration/CodeGenerationTemplates/ModuleTestsCsProj.txt b/src/Orchard.Web/Modules/Orchard.CodeGeneration/CodeGenerationTemplates/ModuleTestsCsProj.txt index 88abe3e82..ea96491a7 100644 --- a/src/Orchard.Web/Modules/Orchard.CodeGeneration/CodeGenerationTemplates/ModuleTestsCsProj.txt +++ b/src/Orchard.Web/Modules/Orchard.CodeGeneration/CodeGenerationTemplates/ModuleTestsCsProj.txt @@ -21,7 +21,7 @@ DEBUG;TRACE prompt 4 - ..\..\..\OrchardBasicCorrectness.ruleset + ..\..\..\..\OrchardBasicCorrectness.ruleset false @@ -35,16 +35,22 @@ false - + ..\..\..\..\packages\Autofac.3.5.2\lib\net40\Autofac.dll ..\..\..\..\packages\Moq.4.2.1510.2205\lib\net40\Moq.dll - - ..\..\..\..\packages\NHibernate.5.3.10\lib\net461\NHibernate.dll + + ..\..\..\packages\NHibernate.5.5.2\lib\net48\NHibernate.dll - + + ..\..\..\packages\Remotion.Linq.2.2.0\lib\net45\Remotion.Linq.dll + + + ..\..\..\packages\Remotion.Linq.EagerFetching.2.2.0\lib\net45\Remotion.Linq.EagerFetching.dll + + ..\..\..\..\packages\NUnit.2.5.10.11092\lib\nunit.framework.dll diff --git a/src/Orchard.Web/Modules/Orchard.CodeGeneration/CodeGenerationTemplates/ModuleTestsPackagesConfig.txt b/src/Orchard.Web/Modules/Orchard.CodeGeneration/CodeGenerationTemplates/ModuleTestsPackagesConfig.txt new file mode 100644 index 000000000..2bc885670 --- /dev/null +++ b/src/Orchard.Web/Modules/Orchard.CodeGeneration/CodeGenerationTemplates/ModuleTestsPackagesConfig.txt @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.CodeGeneration/Commands/CodeGenerationCommands.cs b/src/Orchard.Web/Modules/Orchard.CodeGeneration/Commands/CodeGenerationCommands.cs index 0e22fc604..ca87d17c5 100644 --- a/src/Orchard.Web/Modules/Orchard.CodeGeneration/Commands/CodeGenerationCommands.cs +++ b/src/Orchard.Web/Modules/Orchard.CodeGeneration/Commands/CodeGenerationCommands.cs @@ -161,6 +161,8 @@ namespace Orchard.CodeGeneration.Commands { templateText = templateText.Replace("$$ModuleTypeLibGuid$$", Guid.NewGuid().ToString()); File.WriteAllText(propertiesPath + "\\AssemblyInfo.cs", templateText); content.Add(propertiesPath + "\\AssemblyInfo.cs"); + File.WriteAllText(testsPath + "packages.config", File.ReadAllText(_codeGenTemplatePath + "ModuleTestsPackagesConfig.txt")); + content.Add(testsPath + "packages.config"); var itemGroup = CreateProjectItemGroup(testsPath, content, folders); @@ -168,7 +170,7 @@ namespace Orchard.CodeGeneration.Commands { csprojText = csprojText.Replace("$$ProjectName$$", projectName); csprojText = csprojText.Replace("$$TestsProjectGuid$$", projectGuid); csprojText = csprojText.Replace("$$FileIncludes$$", itemGroup ?? ""); - csprojText = csprojText.Replace("$$OrchardReferences$$", GetOrchardReferences()); + csprojText = csprojText.Replace("$$OrchardReferences$$", GetOrchardReferences(modulesFolderRelativeDepth: 3)); File.WriteAllText(testsPath + projectName + ".csproj", csprojText); @@ -327,15 +329,17 @@ namespace Orchard.CodeGeneration.Commands { return text; } - private static string GetOrchardReferences() { + private static string GetOrchardReferences(int modulesFolderRelativeDepth = 2) { + var frameworkRelativeDepth = string.Join("\\", Enumerable.Repeat("..", modulesFolderRelativeDepth + 1)); + var coreRelativeDepth = string.Join("\\", Enumerable.Repeat("..", modulesFolderRelativeDepth)); return IsSourceEnlistment() ? -@" - {2D1D92BB-4555-4CBE-8D0E-63563D6CE4C6} +$@" + {{2D1D92BB-4555-4CBE-8D0E-63563D6CE4C6}} Orchard.Framework $(MvcBuildViews) - - {9916839C-39FC-4CEB-A5AF-89CA7E87119F} + + {{9916839C-39FC-4CEB-A5AF-89CA7E87119F}} Orchard.Core $(MvcBuildViews) " : diff --git a/src/Orchard.Web/Modules/Orchard.CodeGeneration/Orchard.CodeGeneration.csproj b/src/Orchard.Web/Modules/Orchard.CodeGeneration/Orchard.CodeGeneration.csproj index 05eb8c41b..6565c15f6 100644 --- a/src/Orchard.Web/Modules/Orchard.CodeGeneration/Orchard.CodeGeneration.csproj +++ b/src/Orchard.Web/Modules/Orchard.CodeGeneration/Orchard.CodeGeneration.csproj @@ -88,6 +88,7 @@ + @@ -158,4 +159,4 @@ - + \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.ContentPreview/Orchard.ContentPreview.csproj b/src/Orchard.Web/Modules/Orchard.ContentPreview/Orchard.ContentPreview.csproj index 1db70111c..51ca1d54b 100644 --- a/src/Orchard.Web/Modules/Orchard.ContentPreview/Orchard.ContentPreview.csproj +++ b/src/Orchard.Web/Modules/Orchard.ContentPreview/Orchard.ContentPreview.csproj @@ -70,7 +70,7 @@ True - ..\..\..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll + ..\..\..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll ..\..\..\packages\Owin.1.0\lib\net40\Owin.dll diff --git a/src/Orchard.Web/Modules/Orchard.ContentPreview/packages.config b/src/Orchard.Web/Modules/Orchard.ContentPreview/packages.config index 64f769b11..9ebf8e412 100644 --- a/src/Orchard.Web/Modules/Orchard.ContentPreview/packages.config +++ b/src/Orchard.Web/Modules/Orchard.ContentPreview/packages.config @@ -9,6 +9,6 @@ - + \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.DynamicForms/Orchard.DynamicForms.csproj b/src/Orchard.Web/Modules/Orchard.DynamicForms/Orchard.DynamicForms.csproj index c2cc01b7b..99e69c053 100644 --- a/src/Orchard.Web/Modules/Orchard.DynamicForms/Orchard.DynamicForms.csproj +++ b/src/Orchard.Web/Modules/Orchard.DynamicForms/Orchard.DynamicForms.csproj @@ -66,7 +66,7 @@ ..\..\..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll - ..\..\..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll + ..\..\..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll diff --git a/src/Orchard.Web/Modules/Orchard.DynamicForms/packages.config b/src/Orchard.Web/Modules/Orchard.DynamicForms/packages.config index d4d348283..8278c3120 100644 --- a/src/Orchard.Web/Modules/Orchard.DynamicForms/packages.config +++ b/src/Orchard.Web/Modules/Orchard.DynamicForms/packages.config @@ -8,5 +8,5 @@ - + \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Email/Orchard.Email.csproj b/src/Orchard.Web/Modules/Orchard.Email/Orchard.Email.csproj index fed4b0b6a..5b4f92e9f 100644 --- a/src/Orchard.Web/Modules/Orchard.Email/Orchard.Email.csproj +++ b/src/Orchard.Web/Modules/Orchard.Email/Orchard.Email.csproj @@ -69,7 +69,7 @@ ..\..\..\packages\MimeKit.3.1.1\lib\net48\MimeKit.dll - ..\..\..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll + ..\..\..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll diff --git a/src/Orchard.Web/Modules/Orchard.Email/packages.config b/src/Orchard.Web/Modules/Orchard.Email/packages.config index 36c1ec1d6..58191e638 100644 --- a/src/Orchard.Web/Modules/Orchard.Email/packages.config +++ b/src/Orchard.Web/Modules/Orchard.Email/packages.config @@ -7,7 +7,7 @@ - + \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Fields/Drivers/LinkFieldDriver.cs b/src/Orchard.Web/Modules/Orchard.Fields/Drivers/LinkFieldDriver.cs index 2119023a6..58e8817b0 100644 --- a/src/Orchard.Web/Modules/Orchard.Fields/Drivers/LinkFieldDriver.cs +++ b/src/Orchard.Web/Modules/Orchard.Fields/Drivers/LinkFieldDriver.cs @@ -1,11 +1,10 @@ -using Orchard.ContentManagement; +using System; +using Orchard.ContentManagement; using Orchard.ContentManagement.Drivers; using Orchard.ContentManagement.Handlers; using Orchard.Fields.Fields; using Orchard.Fields.Settings; using Orchard.Localization; -using System; -using System.Collections.Generic; namespace Orchard.Fields.Drivers { public class LinkFieldDriver : ContentFieldDriver { @@ -39,10 +38,10 @@ namespace Orchard.Fields.Drivers { () => { if (part.IsNew()) { var settings = field.PartFieldDefinition.Settings.GetModel(); - if (String.IsNullOrEmpty(field.Value)) { + if (string.IsNullOrEmpty(field.Value)) { field.Value = settings.DefaultValue; } - if (String.IsNullOrEmpty(field.Text)) { + if (string.IsNullOrEmpty(field.Text)) { field.Text = settings.TextDefaultValue; } } @@ -54,13 +53,29 @@ namespace Orchard.Fields.Drivers { if (updater.TryUpdateModel(field, GetPrefix(field, part), null, null)) { var settings = field.PartFieldDefinition.Settings.GetModel(); - if (settings.Required && String.IsNullOrWhiteSpace(field.Value)) { - updater.AddModelError(GetPrefix(field, part), T("Url is required for {0}.", T(field.DisplayName))); + if (settings.Required && string.IsNullOrWhiteSpace(field.Value)) { + updater.AddModelError(GetPrefix(field, part), T("URL is required for {0}.", T(field.DisplayName))); } - else if (!String.IsNullOrWhiteSpace(field.Value) && !Uri.IsWellFormedUriString(field.Value, UriKind.RelativeOrAbsolute)) { - updater.AddModelError(GetPrefix(field, part), T("{0} is an invalid url.", field.Value)); + else if (!string.IsNullOrWhiteSpace(field.Value)) { + // If the URL contains a fragment identifier (#), find its index to validate the URL and fragment separately. + var fragmentIndex = field.Value.IndexOf('#'); + + // The URL is the part of the value before the fragment identifier (#). + var url = fragmentIndex >= 0 ? field.Value.Substring(0, fragmentIndex) : field.Value; + // If the provided value contains a URL (not just a fragment), check if it's a valid URI. + if (!string.IsNullOrEmpty(url) && !Uri.IsWellFormedUriString(url, UriKind.RelativeOrAbsolute)) { + updater.AddModelError(GetPrefix(field, part), T("'{0}' is an invalid URL.", url)); + } + + // The fragment is the part of the value after the fragment identifier (#). + var fragment = fragmentIndex >= 0 ? field.Value.Substring(fragmentIndex + 1) : null; + // If the provided value contains a fragment, check if it contains spaces. + if (!string.IsNullOrEmpty(fragment) && fragment.IndexOf(' ') >= 0) { + updater.AddModelError(GetPrefix(field, part), T("'{0}' is an invalid URL fragment.", fragment)); + } } - else if (settings.LinkTextMode == LinkTextMode.Required && String.IsNullOrWhiteSpace(field.Text)) { + + if (settings.LinkTextMode == LinkTextMode.Required && string.IsNullOrWhiteSpace(field.Text)) { updater.AddModelError(GetPrefix(field, part), T("Text is required for {0}.", T(field.DisplayName))); } } @@ -89,7 +104,7 @@ namespace Orchard.Fields.Drivers { protected override void Describe(DescribeMembersContext context) { context .Member("Text", typeof(string), T("Text"), T("The text of the link.")) - .Member(null, typeof(string), T("Url"), T("The url of the link.")) + .Member(null, typeof(string), T("Url"), T("The URL of the link.")) .Enumerate(() => field => new[] { field.Value }); } } diff --git a/src/Orchard.Web/Modules/Orchard.Fields/Views/EditorTemplates/Fields/Link.Edit.cshtml b/src/Orchard.Web/Modules/Orchard.Fields/Views/EditorTemplates/Fields/Link.Edit.cshtml index 51626db4a..a74519ad4 100644 --- a/src/Orchard.Web/Modules/Orchard.Fields/Views/EditorTemplates/Fields/Link.Edit.cshtml +++ b/src/Orchard.Web/Modules/Orchard.Fields/Views/EditorTemplates/Fields/Link.Edit.cshtml @@ -25,7 +25,7 @@
@(settings.Required ? Html.TextBoxFor(m => m.Value, new { @class = "text large", placeholder = settings.UrlPlaceholder, required = "required" }) : Html.TextBoxFor(m => m.Value, new { @class = "text large", placeholder = settings.UrlPlaceholder })) - @T("A valid url, i.e. http://orchardproject.net, /content/file.pdf, ...") + @T("A valid url, i.e. http://orchardproject.net, /content/file.pdf, #some_id, ...")
@if (settings.LinkTextMode == LinkTextMode.Optional || settings.LinkTextMode == LinkTextMode.Required) {
diff --git a/src/Orchard.Web/Modules/Orchard.Forms/Orchard.Forms.csproj b/src/Orchard.Web/Modules/Orchard.Forms/Orchard.Forms.csproj index e4fa58018..3448e7089 100644 --- a/src/Orchard.Web/Modules/Orchard.Forms/Orchard.Forms.csproj +++ b/src/Orchard.Web/Modules/Orchard.Forms/Orchard.Forms.csproj @@ -55,7 +55,7 @@ ..\..\..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll - ..\..\..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll + ..\..\..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll @@ -173,4 +173,4 @@ - + \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Forms/packages.config b/src/Orchard.Web/Modules/Orchard.Forms/packages.config index f89bcaa42..423014ad0 100644 --- a/src/Orchard.Web/Modules/Orchard.Forms/packages.config +++ b/src/Orchard.Web/Modules/Orchard.Forms/packages.config @@ -4,5 +4,5 @@ - - + + \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Glimpse/Orchard.Glimpse.csproj b/src/Orchard.Web/Modules/Orchard.Glimpse/Orchard.Glimpse.csproj index 3d96c1ede..57dc00d47 100644 --- a/src/Orchard.Web/Modules/Orchard.Glimpse/Orchard.Glimpse.csproj +++ b/src/Orchard.Web/Modules/Orchard.Glimpse/Orchard.Glimpse.csproj @@ -93,7 +93,7 @@ ..\..\..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll - ..\..\..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll + ..\..\..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll ..\..\..\packages\NHibernate.5.5.2\lib\net48\NHibernate.dll diff --git a/src/Orchard.Web/Modules/Orchard.Glimpse/packages.config b/src/Orchard.Web/Modules/Orchard.Glimpse/packages.config index d270e01bd..1016476d1 100644 --- a/src/Orchard.Web/Modules/Orchard.Glimpse/packages.config +++ b/src/Orchard.Web/Modules/Orchard.Glimpse/packages.config @@ -17,7 +17,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.JobsQueue/Orchard.JobsQueue.csproj b/src/Orchard.Web/Modules/Orchard.JobsQueue/Orchard.JobsQueue.csproj index 777c55762..7d665223d 100644 --- a/src/Orchard.Web/Modules/Orchard.JobsQueue/Orchard.JobsQueue.csproj +++ b/src/Orchard.Web/Modules/Orchard.JobsQueue/Orchard.JobsQueue.csproj @@ -61,7 +61,7 @@ ..\..\..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll - ..\..\..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll + ..\..\..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll @@ -196,4 +196,4 @@ - + \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.JobsQueue/packages.config b/src/Orchard.Web/Modules/Orchard.JobsQueue/packages.config index d8ef6eca5..4edd53141 100644 --- a/src/Orchard.Web/Modules/Orchard.JobsQueue/packages.config +++ b/src/Orchard.Web/Modules/Orchard.JobsQueue/packages.config @@ -5,5 +5,5 @@ - - + + \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Layouts/Orchard.Layouts.csproj b/src/Orchard.Web/Modules/Orchard.Layouts/Orchard.Layouts.csproj index e207903e8..dc49ab00f 100644 --- a/src/Orchard.Web/Modules/Orchard.Layouts/Orchard.Layouts.csproj +++ b/src/Orchard.Web/Modules/Orchard.Layouts/Orchard.Layouts.csproj @@ -59,7 +59,7 @@ ..\..\..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll - ..\..\..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll + ..\..\..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll diff --git a/src/Orchard.Web/Modules/Orchard.Layouts/packages.config b/src/Orchard.Web/Modules/Orchard.Layouts/packages.config index 03c87ed9a..9504b7d9d 100644 --- a/src/Orchard.Web/Modules/Orchard.Layouts/packages.config +++ b/src/Orchard.Web/Modules/Orchard.Layouts/packages.config @@ -7,6 +7,6 @@ - + \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Media/Orchard.Media.csproj b/src/Orchard.Web/Modules/Orchard.Media/Orchard.Media.csproj index b01ce63de..c4a391378 100644 --- a/src/Orchard.Web/Modules/Orchard.Media/Orchard.Media.csproj +++ b/src/Orchard.Web/Modules/Orchard.Media/Orchard.Media.csproj @@ -52,9 +52,6 @@ false - - ..\..\..\packages\DotNetZip.1.12.0\lib\net20\DotNetZip.dll - ..\..\..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.4.1.0\lib\net472\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll @@ -64,6 +61,7 @@ + @@ -204,4 +202,4 @@ - + \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Media/Services/MediaService.cs b/src/Orchard.Web/Modules/Orchard.Media/Services/MediaService.cs index f11190b7c..3084bd871 100644 --- a/src/Orchard.Web/Modules/Orchard.Media/Services/MediaService.cs +++ b/src/Orchard.Web/Modules/Orchard.Media/Services/MediaService.cs @@ -1,9 +1,9 @@ using System; using System.Collections.Generic; using System.IO; +using System.IO.Compression; using System.Linq; using System.Web; -using Ionic.Zip; using Orchard.ContentManagement; using Orchard.FileSystems.Media; using Orchard.Localization; @@ -194,7 +194,7 @@ namespace Orchard.Media.Services { /// The array of bytes with the file's contents. /// Boolean value indicating weather zip files should be extracted. /// The path to the uploaded file. - public string UploadMediaFile(string folderPath, string fileName, byte [] bytes, bool extractZip) { + public string UploadMediaFile(string folderPath, string fileName, byte[] bytes, bool extractZip) { Argument.ThrowIfNullOrEmpty(folderPath, "folderPath"); Argument.ThrowIfNullOrEmpty(fileName, "fileName"); Argument.ThrowIfNull(bytes, "bytes"); @@ -274,16 +274,16 @@ namespace Orchard.Media.Services { // must be in the whitelist MediaSettingsPart mediaSettings = currentSite.As(); - + if (mediaSettings == null) { return false; - } - - if(String.IsNullOrWhiteSpace(mediaSettings.UploadAllowedFileTypeWhitelist)) { - return true; - } + } - if(!mediaSettings.UploadAllowedFileTypeWhitelist.ToUpperInvariant().Split(' ').Contains(extension.ToUpperInvariant())) { + if (String.IsNullOrWhiteSpace(mediaSettings.UploadAllowedFileTypeWhitelist)) { + return true; + } + + if (!mediaSettings.UploadAllowedFileTypeWhitelist.ToUpperInvariant().Split(' ').Contains(extension.ToUpperInvariant())) { return false; } } @@ -305,28 +305,26 @@ namespace Orchard.Media.Services { Argument.ThrowIfNullOrEmpty(targetFolder, "targetFolder"); Argument.ThrowIfNull(zipStream, "zipStream"); - using (var fileInflater = ZipFile.Read(zipStream)) { + using (var fileInflater = new ZipArchive(zipStream)) { // We want to preserve whatever directory structure the zip file contained instead // of flattening it. // The API below doesn't necessarily return the entries in the zip file in any order. // That means the files in subdirectories can be returned as entries from the stream // before the directories that contain them, so we create directories as soon as first // file below their path is encountered. - foreach (ZipEntry entry in fileInflater) { + foreach (var entry in fileInflater.Entries) { if (entry == null) { continue; } - if (!entry.IsDirectory && !string.IsNullOrEmpty(entry.FileName)) { - + if (!string.IsNullOrEmpty(entry.Name)) { // skip disallowed files - if (FileAllowed(entry.FileName, false)) { - string fullFileName = _storageProvider.Combine(targetFolder, entry.FileName); + if (FileAllowed(entry.Name, false)) { + string fullFileName = _storageProvider.Combine(targetFolder, entry.FullName); - using (var stream = entry.OpenReader()) { + using (var stream = entry.Open()) { // the call will return false if the file already exists if (!_storageProvider.TrySaveStream(fullFileName, stream)) { - // try to delete the file and save again try { _storageProvider.DeleteFile(fullFileName); diff --git a/src/Orchard.Web/Modules/Orchard.Media/packages.config b/src/Orchard.Web/Modules/Orchard.Media/packages.config index 5de97f737..1c55d6960 100644 --- a/src/Orchard.Web/Modules/Orchard.Media/packages.config +++ b/src/Orchard.Web/Modules/Orchard.Media/packages.config @@ -1,6 +1,5 @@  - diff --git a/src/Orchard.Web/Modules/Orchard.MediaLibrary.WebSearch/Orchard.MediaLibrary.WebSearch.csproj b/src/Orchard.Web/Modules/Orchard.MediaLibrary.WebSearch/Orchard.MediaLibrary.WebSearch.csproj index a0ad8e13e..8ba3b6265 100644 --- a/src/Orchard.Web/Modules/Orchard.MediaLibrary.WebSearch/Orchard.MediaLibrary.WebSearch.csproj +++ b/src/Orchard.Web/Modules/Orchard.MediaLibrary.WebSearch/Orchard.MediaLibrary.WebSearch.csproj @@ -70,7 +70,7 @@ True - ..\..\..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll + ..\..\..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll ..\..\..\packages\Owin.1.0\lib\net40\Owin.dll diff --git a/src/Orchard.Web/Modules/Orchard.MediaLibrary.WebSearch/packages.config b/src/Orchard.Web/Modules/Orchard.MediaLibrary.WebSearch/packages.config index 1909aa2de..0d0c84214 100644 --- a/src/Orchard.Web/Modules/Orchard.MediaLibrary.WebSearch/packages.config +++ b/src/Orchard.Web/Modules/Orchard.MediaLibrary.WebSearch/packages.config @@ -11,7 +11,7 @@ - + \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.MediaLibrary/Orchard.MediaLibrary.csproj b/src/Orchard.Web/Modules/Orchard.MediaLibrary/Orchard.MediaLibrary.csproj index 515420a2c..2e853111b 100644 --- a/src/Orchard.Web/Modules/Orchard.MediaLibrary/Orchard.MediaLibrary.csproj +++ b/src/Orchard.Web/Modules/Orchard.MediaLibrary/Orchard.MediaLibrary.csproj @@ -59,7 +59,7 @@ ..\..\..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll - ..\..\..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll + ..\..\..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll @@ -477,4 +477,4 @@ - + \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.MediaLibrary/packages.config b/src/Orchard.Web/Modules/Orchard.MediaLibrary/packages.config index d8ef6eca5..4edd53141 100644 --- a/src/Orchard.Web/Modules/Orchard.MediaLibrary/packages.config +++ b/src/Orchard.Web/Modules/Orchard.MediaLibrary/packages.config @@ -5,5 +5,5 @@ - - + + \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.OpenId/Orchard.OpenId.csproj b/src/Orchard.Web/Modules/Orchard.OpenId/Orchard.OpenId.csproj index afa5289d6..7e2f6ac11 100644 --- a/src/Orchard.Web/Modules/Orchard.OpenId/Orchard.OpenId.csproj +++ b/src/Orchard.Web/Modules/Orchard.OpenId/Orchard.OpenId.csproj @@ -149,7 +149,7 @@ True - ..\..\..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll + ..\..\..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll ..\..\..\packages\NHibernate.5.5.2\lib\net48\NHibernate.dll diff --git a/src/Orchard.Web/Modules/Orchard.OpenId/packages.config b/src/Orchard.Web/Modules/Orchard.OpenId/packages.config index e9c55374d..fe8ac6636 100644 --- a/src/Orchard.Web/Modules/Orchard.OpenId/packages.config +++ b/src/Orchard.Web/Modules/Orchard.OpenId/packages.config @@ -33,7 +33,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.Projections/Migrations.cs b/src/Orchard.Web/Modules/Orchard.Projections/Migrations.cs index 982520d91..db74e610d 100644 --- a/src/Orchard.Web/Modules/Orchard.Projections/Migrations.cs +++ b/src/Orchard.Web/Modules/Orchard.Projections/Migrations.cs @@ -102,17 +102,7 @@ namespace Orchard.Projections { SchemaBuilder.CreateTable("FieldIndexPartRecord", table => table.ContentPartRecord()); //Adds indexes for better performances in queries - SchemaBuilder.AlterTable("StringFieldIndexRecord", table => table.CreateIndex("IX_PropertyName", new string[] { "PropertyName" })); - SchemaBuilder.AlterTable("StringFieldIndexRecord", table => table.CreateIndex("IX_FieldIndexPartRecord_Id", new string[] { "FieldIndexPartRecord_Id" })); - - SchemaBuilder.AlterTable("IntegerFieldIndexRecord", table => table.CreateIndex("IX_PropertyName", new string[] { "PropertyName" })); - SchemaBuilder.AlterTable("IntegerFieldIndexRecord", table => table.CreateIndex("IX_FieldIndexPartRecord_Id", new string[] { "FieldIndexPartRecord_Id" })); - - SchemaBuilder.AlterTable("DoubleFieldIndexRecord", table => table.CreateIndex("IX_PropertyName", new string[] { "PropertyName" })); - SchemaBuilder.AlterTable("DoubleFieldIndexRecord", table => table.CreateIndex("IX_FieldIndexPartRecord_Id", new string[] { "FieldIndexPartRecord_Id" })); - - SchemaBuilder.AlterTable("DecimalFieldIndexRecord", table => table.CreateIndex("IX_PropertyName", new string[] { "PropertyName" })); - SchemaBuilder.AlterTable("DecimalFieldIndexRecord", table => table.CreateIndex("IX_FieldIndexPartRecord_Id", new string[] { "FieldIndexPartRecord_Id" })); + AddPropertyNameAndFieldIndexPartRecordIdIndexes(); // Query @@ -318,7 +308,7 @@ namespace Orchard.Projections { Description = T("The text from the Body part").Text }); - return 7; + return 8; } public int UpdateFrom1() { @@ -375,22 +365,7 @@ namespace Orchard.Projections { .AddColumn("LatestValue")); //Adds indexes for better performances in queries - SchemaBuilder.AlterTable("StringFieldIndexRecord", table => { - table.CreateIndex("IDX_Orchard_Projections_PropertyName", "PropertyName"); - table.CreateIndex("IDX_Orchard_Projections_StringFieldIndexRecord", "FieldIndexPartRecord_Id"); - }); - SchemaBuilder.AlterTable("IntegerFieldIndexRecord", table => { - table.CreateIndex("IDX_Orchard_Projections_PropertyName", "PropertyName"); - table.CreateIndex("IDX_Orchard_Projections_IntegerFieldIndexRecord", "FieldIndexPartRecord_Id"); - }); - SchemaBuilder.AlterTable("DoubleFieldIndexRecord", table => { - table.CreateIndex("IDX_Orchard_Projections_PropertyName", "PropertyName"); - table.CreateIndex("IDX_Orchard_Projections_DoubleFieldIndexRecord", "FieldIndexPartRecord_Id"); - }); - SchemaBuilder.AlterTable("DecimalFieldIndexRecord", table => { - table.CreateIndex("IDX_Orchard_Projections_PropertyName", "PropertyName"); - table.CreateIndex("IDX_Orchard_Projections_DecimalFieldIndexRecords", "FieldIndexPartRecord_Id"); - }); + AddPropertyNameAndFieldIndexPartRecordIdIndexes(); SchemaBuilder.AlterTable("QueryPartRecord", table => table .AddColumn("VersionScope", c => c.WithLength(15))); @@ -434,6 +409,29 @@ namespace Orchard.Projections { return 7; } + public int UpdateFrom7() { + SchemaBuilder.AlterTable("StringFieldIndexRecord", table => { + table.DropIndex("IX_PropertyName"); + table.DropIndex("IX_FieldIndexPartRecord_Id"); + }); + SchemaBuilder.AlterTable("IntegerFieldIndexRecord", table => { + table.DropIndex("IX_PropertyName"); + table.DropIndex("IX_FieldIndexPartRecord_Id"); + }); + SchemaBuilder.AlterTable("DoubleFieldIndexRecord", table => { + table.DropIndex("IX_PropertyName"); + table.DropIndex("IX_FieldIndexPartRecord_Id"); + }); + SchemaBuilder.AlterTable("DecimalFieldIndexRecord", table => { + table.DropIndex("IX_PropertyName"); + table.DropIndex("IX_FieldIndexPartRecord_Id"); + }); + + AddPropertyNameAndFieldIndexPartRecordIdIndexes(); + + return 8; + } + // This change was originally in UpdateFrom5 on dev, but didn't exist on 1.10.x. private void MigratePropertyRecordToRewriteOutputCondition() { SchemaBuilder.AlterTable("PropertyRecord", table => table @@ -446,5 +444,24 @@ namespace Orchard.Projections { if (property.RewriteOutput) property.RewriteOutputCondition = "true"; #pragma warning restore CS0618 // Type or member is obsolete } + + private void AddPropertyNameAndFieldIndexPartRecordIdIndexes() { + SchemaBuilder.AlterTable("StringFieldIndexRecord", table => { + table.CreateIndex("IDX_StringFieldIndexRecord_PropertyName", "PropertyName"); + table.CreateIndex("IDX_StringFieldIndexRecord_FieldIndexPartRecord_Id", "FieldIndexPartRecord_Id"); + }); + SchemaBuilder.AlterTable("IntegerFieldIndexRecord", table => { + table.CreateIndex("IDX_IntegerFieldIndexRecord_PropertyName", "PropertyName"); + table.CreateIndex("IDX_IntegerFieldIndexRecord_FieldIndexPartRecord_Id", "FieldIndexPartRecord_Id"); + }); + SchemaBuilder.AlterTable("DoubleFieldIndexRecord", table => { + table.CreateIndex("IDX_DoubleFieldIndexRecord_PropertyName", "PropertyName"); + table.CreateIndex("IDX_DoubleFieldIndexRecord_FieldIndexPartRecord_Id", "FieldIndexPartRecord_Id"); + }); + SchemaBuilder.AlterTable("DecimalFieldIndexRecord", table => { + table.CreateIndex("IDX_DecimalFieldIndexRecord_PropertyName", "PropertyName"); + table.CreateIndex("IDX_DecimalFieldIndexRecord_FieldIndexPartRecord_Id", "FieldIndexPartRecord_Id"); + }); + } } } diff --git a/src/Orchard.Web/Modules/Orchard.Redis/Orchard.Redis.csproj b/src/Orchard.Web/Modules/Orchard.Redis/Orchard.Redis.csproj index 6dec16547..6c3a365b5 100644 --- a/src/Orchard.Web/Modules/Orchard.Redis/Orchard.Redis.csproj +++ b/src/Orchard.Web/Modules/Orchard.Redis/Orchard.Redis.csproj @@ -57,7 +57,7 @@ - ..\..\..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll + ..\..\..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll ..\..\..\packages\NHibernate.5.5.2\lib\net48\NHibernate.dll diff --git a/src/Orchard.Web/Modules/Orchard.Redis/packages.config b/src/Orchard.Web/Modules/Orchard.Redis/packages.config index 6dac1b0ba..cf370c86e 100644 --- a/src/Orchard.Web/Modules/Orchard.Redis/packages.config +++ b/src/Orchard.Web/Modules/Orchard.Redis/packages.config @@ -2,7 +2,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.Resources/Web.config b/src/Orchard.Web/Modules/Orchard.Resources/Web.config index bb5b97622..e3a7525f6 100644 --- a/src/Orchard.Web/Modules/Orchard.Resources/Web.config +++ b/src/Orchard.Web/Modules/Orchard.Resources/Web.config @@ -57,10 +57,6 @@ - - - - diff --git a/src/Orchard.Web/Modules/Orchard.Roles/Orchard.Roles.csproj b/src/Orchard.Web/Modules/Orchard.Roles/Orchard.Roles.csproj index 47ae87ddf..82fab8a1a 100644 --- a/src/Orchard.Web/Modules/Orchard.Roles/Orchard.Roles.csproj +++ b/src/Orchard.Web/Modules/Orchard.Roles/Orchard.Roles.csproj @@ -60,7 +60,7 @@ ..\..\..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll - ..\..\..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll + ..\..\..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll diff --git a/src/Orchard.Web/Modules/Orchard.Roles/packages.config b/src/Orchard.Web/Modules/Orchard.Roles/packages.config index d8ef6eca5..4edd53141 100644 --- a/src/Orchard.Web/Modules/Orchard.Roles/packages.config +++ b/src/Orchard.Web/Modules/Orchard.Roles/packages.config @@ -5,5 +5,5 @@ - - + + \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Taxonomies/Orchard.Taxonomies.csproj b/src/Orchard.Web/Modules/Orchard.Taxonomies/Orchard.Taxonomies.csproj index a10e41975..35fee3518 100644 --- a/src/Orchard.Web/Modules/Orchard.Taxonomies/Orchard.Taxonomies.csproj +++ b/src/Orchard.Web/Modules/Orchard.Taxonomies/Orchard.Taxonomies.csproj @@ -66,7 +66,7 @@ ..\..\..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll - ..\..\..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll + ..\..\..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll ..\..\..\packages\NHibernate.5.5.2\lib\net48\NHibernate.dll diff --git a/src/Orchard.Web/Modules/Orchard.Taxonomies/packages.config b/src/Orchard.Web/Modules/Orchard.Taxonomies/packages.config index 026caa7c6..b72e2e7d4 100644 --- a/src/Orchard.Web/Modules/Orchard.Taxonomies/packages.config +++ b/src/Orchard.Web/Modules/Orchard.Taxonomies/packages.config @@ -9,7 +9,7 @@ - + diff --git a/src/Orchard.Web/Modules/Orchard.Workflows/Orchard.Workflows.csproj b/src/Orchard.Web/Modules/Orchard.Workflows/Orchard.Workflows.csproj index 88bc8e818..58c89a536 100644 --- a/src/Orchard.Web/Modules/Orchard.Workflows/Orchard.Workflows.csproj +++ b/src/Orchard.Web/Modules/Orchard.Workflows/Orchard.Workflows.csproj @@ -59,7 +59,7 @@ ..\..\..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll - ..\..\..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll + ..\..\..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll @@ -292,4 +292,4 @@ - + \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Orchard.Workflows/packages.config b/src/Orchard.Web/Modules/Orchard.Workflows/packages.config index d8ef6eca5..4edd53141 100644 --- a/src/Orchard.Web/Modules/Orchard.Workflows/packages.config +++ b/src/Orchard.Web/Modules/Orchard.Workflows/packages.config @@ -5,5 +5,5 @@ - - + + \ No newline at end of file diff --git a/src/Orchard.Web/Modules/Upgrade/Upgrade.csproj b/src/Orchard.Web/Modules/Upgrade/Upgrade.csproj index 900e693ef..183270003 100644 --- a/src/Orchard.Web/Modules/Upgrade/Upgrade.csproj +++ b/src/Orchard.Web/Modules/Upgrade/Upgrade.csproj @@ -65,7 +65,7 @@ ..\..\..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll - ..\..\..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll + ..\..\..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll ..\..\..\packages\NHibernate.5.5.2\lib\net48\NHibernate.dll diff --git a/src/Orchard.Web/Modules/Upgrade/packages.config b/src/Orchard.Web/Modules/Upgrade/packages.config index 026caa7c6..b72e2e7d4 100644 --- a/src/Orchard.Web/Modules/Upgrade/packages.config +++ b/src/Orchard.Web/Modules/Upgrade/packages.config @@ -9,7 +9,7 @@ - + diff --git a/src/Orchard.Web/Orchard.Web.csproj b/src/Orchard.Web/Orchard.Web.csproj index b9241408c..2a0328d58 100644 --- a/src/Orchard.Web/Orchard.Web.csproj +++ b/src/Orchard.Web/Orchard.Web.csproj @@ -79,17 +79,14 @@ ..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll - - ..\packages\Npgsql.2.2.3\lib\net45\Mono.Security.dll - ..\packages\MySql.Data.6.7.9\lib\net45\MySql.Data.dll - ..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll + ..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll - - ..\packages\Npgsql.2.2.3\lib\net45\Npgsql.dll + + ..\packages\Npgsql.4.0.17\lib\net451\Npgsql.dll ..\packages\Orchard.NuGet.Core.1.1.0.0\lib\NuGet.Core.dll @@ -98,6 +95,9 @@ ..\packages\Owin.1.0\lib\net40\Owin.dll + + ..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll + 3.5 @@ -107,7 +107,23 @@ ..\..\lib\sqlce\System.Data.SqlServerCe.dll True + + ..\packages\System.Memory.4.5.4\lib\net461\System.Memory.dll + + + + ..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll + + + ..\packages\System.Runtime.CompilerServices.Unsafe.4.5.3\lib\net461\System.Runtime.CompilerServices.Unsafe.dll + + + ..\packages\System.Threading.Tasks.Extensions.4.5.2\lib\netstandard2.0\System.Threading.Tasks.Extensions.dll + + + ..\packages\System.ValueTuple.4.5.0\lib\net47\System.ValueTuple.dll + diff --git a/src/Orchard.Web/Web.config b/src/Orchard.Web/Web.config index f09cefc7d..2a9fe8447 100644 --- a/src/Orchard.Web/Web.config +++ b/src/Orchard.Web/Web.config @@ -265,6 +265,14 @@ + + + + + + + + diff --git a/src/Orchard.Web/packages.config b/src/Orchard.Web/packages.config index de35a60b1..115a00a16 100644 --- a/src/Orchard.Web/packages.config +++ b/src/Orchard.Web/packages.config @@ -13,8 +13,14 @@ - - + + + + + + + + \ No newline at end of file diff --git a/src/Orchard/Orchard.Framework.csproj b/src/Orchard/Orchard.Framework.csproj index a0c6e6811..2a14424c5 100644 --- a/src/Orchard/Orchard.Framework.csproj +++ b/src/Orchard/Orchard.Framework.csproj @@ -87,7 +87,7 @@ ..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll - ..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll + ..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll ..\packages\NHibernate.5.5.2\lib\net48\NHibernate.dll diff --git a/src/Orchard/packages.config b/src/Orchard/packages.config index 38f17ba70..bc7246142 100644 --- a/src/Orchard/packages.config +++ b/src/Orchard/packages.config @@ -15,7 +15,7 @@ - +