Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Adding 2sxc Content module results with Error: System.ArgumentNullException #3584

Closed
4 tasks done
tvatavuk opened this issue Feb 24, 2025 · 2 comments
Closed
4 tasks done
Assignees

Comments

@tvatavuk
Copy link
Contributor

Bug Affects...

  • edit experience / UI
  • admin experience / UI
  • Platform parts (Oqtane)
  • other / unknown

Current Behavior / Expected Behavior

Adding 2sxc Content module results with Error: System.ArgumentNullException

Image

Error:

System.ArgumentNullException: Value cannot be null. (Parameter 'collection')
   at System.Collections.Generic.List`1.AddRange(IEnumerable`1 collection)
   at ToSic.Eav.Apps.Services.AppDataStackService.GetStack(AppThingsIdentifiers target, IEntity viewPart)
   at ToSic.Eav.Apps.Services.AppDataStackService.GetStack(String part, IEntity viewPart)
   at ToSic.Eav.Context.Internal.ContextOfApp.<get_AppSettings>b__22_0()
   at ToSic.Lib.Helpers.GetOnce`1.Get(Func`1 generator)
   at ToSic.Eav.Context.Internal.ContextOfApp.get_AppSettings()
   at ToSic.Sxc.LookUp.Internal.SxcAppDataConfigProvider.GetLookupEngineForContext(IContextOfSite context, IApp appForLookup, IBlock blockForLookupOrNull)
   at ToSic.Sxc.LookUp.Internal.SxcAppDataConfigProvider.GetDataConfiguration(EavApp app, AppDataConfigSpecs specs)
   at ToSic.Eav.Apps.Internal.EavApp.<get_AppDataConfig>b__22_0()
   at ToSic.Lib.Helpers.GetOnce`1.Get(Func`1 generator)
   at ToSic.Eav.Apps.Internal.EavApp.get_AppDataConfig()
   at ToSic.Eav.Apps.Internal.EavApp.<get_ConfigurationProvider>b__19_0()
   at ToSic.Lib.Helpers.GetOnce`1.Get(Func`1 generator)
   at ToSic.Eav.Apps.Internal.EavApp.get_ConfigurationProvider()
   at ToSic.Eav.Apps.Internal.EavApp.BuildData[TDataSource,TResult]()
   at ToSic.Eav.Apps.Internal.EavApp.get_Data()
   at ToSic.Sxc.Web.Internal.JsContext.JsContextAll.GetJsContext(String systemRootUrl, IBlock block, String errorCode, List`1 exsOrNull, RenderStatistics statistics)
   at ToSic.Sxc.Blocks.Internal.Render.RenderingHelper.ContextAttributes(Int32 instanceId, Int32 contentBlockId, Boolean includeEditInfos, Boolean includeJsApiContext, String errorCode, List`1 exsOrNull, RenderStatistics statistics)
   at ToSic.Sxc.Blocks.Internal.Render.RenderingHelper.WrapInContext(String content, NoParamOrder noParamOrder, Int32 instanceId, Int32 contentBlockId, Boolean editContext, Boolean jsApiContext, String tag, Boolean addLineBreaks, String errorCode, List`1 exsOrNull, RenderStatistics statistics)
   at ToSic.Sxc.Blocks.Internal.BlockBuilder.RenderInternal(RenderSpecs specs)

Expected Behavior: Adding the module should successfully initialize the content module without throwing an exception.

To Reproduce (Steps, Videos, Screenshots, Apps)

  1. Using Oqtane 6.1.0 with the latest net9.0 and installing the latest 2sxc (19.03.01)
  2. Add the 2sxc Content module to a page
  3. Observe the error: "System.ArgumentNullException: Value cannot be null."

Your environment

  • 2sxc version(s): 19.03.01
  • Browser: all
  • DNN / Oqtane: Oqtane 6.1.0
  • Hosting platform: all
  • Ui Languages: any/all

Additional context

There are other 2sxc variations of the same issue that may result in different exceptions. For example:

  • Adding the APP module results in a 400 (Bad Request) on the api/sxc/cms/block/Apps?apps= endpoint.

Image

This error happens when using <LangVersion>preview</LangVersion> with EFCore 9.0.x.

Core issue appears related to:

tvatavuk added a commit to 2sic/eav-server that referenced this issue Feb 24, 2025
@tvatavuk tvatavuk self-assigned this Feb 25, 2025
@github-project-automation github-project-automation bot moved this to Done in 2sxc 19 Feb 27, 2025
@iJungleboy iJungleboy moved this from Done to v19.03.02 LTS in 2sxc 19 Mar 5, 2025
@iJungleboy
Copy link
Contributor

Found more cases of this in the app-delete routines...

@iJungleboy iJungleboy reopened this Mar 11, 2025
@iJungleboy iJungleboy moved this from v19.03.02 LTS to Done in 2sxc 19 Mar 11, 2025
@iJungleboy iJungleboy closed this as completed by moving to Done in 2sxc 19 Mar 11, 2025
@iJungleboy
Copy link
Contributor

Added more such workaaround code...

@iJungleboy iJungleboy moved this from Done to v19.03.03 LTS in 2sxc 19 Mar 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: v19.03.03 LTS
Development

No branches or pull requests

2 participants