mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
Disabling upgrade actions if the target modules are not enabled
--HG-- branch : 1.x
This commit is contained in:
@@ -34,9 +34,13 @@ namespace Upgrade.Controllers {
|
||||
public ILogger Logger { get; set; }
|
||||
|
||||
public ActionResult Index() {
|
||||
if(_featureManager.GetEnabledFeatures().All(x => x.Id != "Orchard.MediaLibrary")) {
|
||||
ViewBag.CanMigrate = false;
|
||||
if (_featureManager.GetEnabledFeatures().All(x => x.Id != "Orchard.MediaLibrary")) {
|
||||
_orchardServices.Notifier.Warning(T("You need to enable Orchard.MediaLibrary in order to convert current media files to the Media Library."));
|
||||
}
|
||||
else {
|
||||
ViewBag.CanMigrate = true;
|
||||
}
|
||||
|
||||
return View();
|
||||
}
|
||||
|
||||
@@ -31,6 +31,8 @@ namespace Upgrade.Controllers {
|
||||
public ILogger Logger { get; set; }
|
||||
|
||||
public ActionResult Index() {
|
||||
ViewBag.CanMigrate = false;
|
||||
|
||||
if(_featureManager.GetEnabledFeatures().All(x => x.Id != "Orchard.Taxonomies")) {
|
||||
_orchardServices.Notifier.Warning(T("You need to enable Orchard.Taxonomies in order to migrate Contrib.Taxonomies to Orchard.Taxonomies."));
|
||||
}
|
||||
@@ -43,6 +45,8 @@ namespace Upgrade.Controllers {
|
||||
if (flag) {
|
||||
_orchardServices.Notifier.Warning(T("This migration step might have been done already."));
|
||||
}
|
||||
|
||||
ViewBag.CanMigrate = true;
|
||||
}
|
||||
|
||||
return View();
|
||||
|
||||
@@ -9,4 +9,4 @@ Category: Developer
|
||||
Features:
|
||||
Upgrade:
|
||||
Description: Provides actions for upgrading Orchard instances
|
||||
Dependencies: Orchard.Autoroute, Title, Navigation, Orchard.MediaLibrary
|
||||
Dependencies: Orchard.Autoroute, Title, Navigation
|
||||
@@ -9,6 +9,8 @@
|
||||
<span class="hint">@T("This migration step will create and organize new Media Content Items based on the media files in your ~/Media folder.")</span>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<button type="submit">@T("Migrate")</button>
|
||||
@if (ViewBag.CanMigrate) {
|
||||
<button type="submit">@T("Migrate")</button>
|
||||
}
|
||||
</fieldset>
|
||||
}
|
||||
@@ -9,6 +9,8 @@
|
||||
<span class="hint">@T("This migration step will convert the Contrib.Taxonomies content items to Orchard.Taxonomies.")</span>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<button type="submit">@T("Migrate")</button>
|
||||
@if (ViewBag.CanMigrate) {
|
||||
<button type="submit">@T("Migrate")</button>
|
||||
}
|
||||
</fieldset>
|
||||
}
|
||||
Reference in New Issue
Block a user