Skip to content

Commit

Permalink
explanation in comment
Browse files Browse the repository at this point in the history
  • Loading branch information
tvatavuk committed Sep 15, 2021
1 parent 9cf4d8f commit 8cc24bb
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions Src/Dnn/ToSic.Sxc.Dnn.Main/DnnBusinessController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,21 @@
// Note about the name
// Some day we should change this namespace to ToSic.Sxc.Dnn.something
// But we can't just do it, because the name is registered in Dnn DBs, so update-scripts would be needed
// TODO: STV - WHY IS THIS NOT PART OF THE DnnBusinessController? it seems that that is already the term in the DB?

// WHY IS THIS NOT PART OF THE DnnBusinessController? it seems that that is already the term in the DB?
// Reason if that can't call StartupDnn().Configure() from ToSic.Sxc.Dnn.DnnBusinessController because of circular dependency
// and need to configure DI before UpgradeModule to fix issue: "Module upgrade did not complete."
// "System.ArgumentNullException: Value cannot be null. Parameter name: provider
// at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider)
// at ToSic.Eav.Factory.GetServiceProvider()"
// ReSharper disable once CheckNamespace
namespace ToSic.SexyContent
{
public class DnnBusinessController: ToSic.Sxc.Dnn.DnnBusinessController, IUpgradeable, IVersionable
{
public new string UpgradeModule(string version)
{
new StartupDnn().Configure();
new StartupDnn().Configure(); // can't call it from ToSic.Sxc.Dnn.DnnBusinessController because of circular dependency
return base.UpgradeModule(version);
}
}
}
}

0 comments on commit 8cc24bb

Please sign in to comment.