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

News App v4.1.1 Throws Error Rendering Inner Content #3252

Closed
jeremy-farrance opened this issue Jan 15, 2024 · 4 comments
Closed

News App v4.1.1 Throws Error Rendering Inner Content #3252

jeremy-farrance opened this issue Jan 15, 2024 · 4 comments
Assignees

Comments

@jeremy-farrance
Copy link

I'm submitting a

[x] bug report

...about

[x] Razor templating

Errors in News App v4.1.1 after upgrading 2sxc

Instructions to Reproduce the Problem

  • Install DNN v9.13.01; empty site
  • install 2sxc v16.07.00
  • on home, add 2sxc App
  • download and install app-news v4.1.1
  • finish module/app setup (assign View)
  • you now see error from Issue #28 (code behind)
  • upgrade 2sxc to v16.09 to fix the issue above
  • List Views now display fine
  • Click through to any Detail View
  • Error 1:
Error: System.ArgumentException: Only '.cs' file paths can start with a slash at ToSic.Sxc.Dnn.RazorCodeManager.get_CodeOrException() in C:\Projects\2sxc\V16\2sxc\Src\Dnn\ToSic.Sxc.Dnn.Razor\Dnn\RazorCodeManager.cs:line 41 at ASP._Page_Portals_0_2sxc_News4__Details_cshtml.Execute() in c:\dev\dnn\dnn91301Test2sxc\Website\Portals\0\2sxc\News4\_Details.cshtml🎯:line 23 at System.Web.WebPages.WebPageBase.ExecutePageHierarchy() at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) at ToSic.Sxc.Engines.DnnRazorEngine.Render(TextWriter writer, Object data) in C:\Projects\2sxc\V16\2sxc\Src\Dnn\ToSic.Sxc.Dnn.Razor\Engines\Razor\DnnRazorEngine.cs:line 109 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at ToSic.Sxc.Engines.DnnRazorEngine.Render(TextWriter writer, Object data) in C:\Projects\2sxc\V16\2sxc\Src\Dnn\ToSic.Sxc.Dnn.Razor\Engines\Razor\DnnRazorEngine.cs:line 116 at ToSic.Sxc.Engines.DnnRazorEngine.RenderTemplate(Object data) in C:\Projects\2sxc\V16\2sxc\Src\Dnn\ToSic.Sxc.Dnn.Razor\Engines\Razor\DnnRazorEngine.cs:line 124 at ToSic.Sxc.Engines.EngineBase.Render(Object data) in C:\Projects\2sxc\V16\2sxc\Src\Sxc\ToSic.Sxc\Engines\EngineBase.cs:line 178 at ToSic.Sxc.Blocks.BlockBuilder.RenderInternal(Object data) in C:\Projects\2sxc\V16\2sxc\Src\Sxc\ToSic.Sxc\Blocks\BlockBuilder_Render.cs:line 134

As a work-around,

  • I move the @ helpers and functions from the .code.cshtml up to the _Details.cshtml, save
  • Error 1 above is bypassed (but, IMHO this still needs to be fixed)
  • But now we have another error that I cannot figure out a way to workaround
  • Error 2, rendering inner content:
Error: System.NullReferenceException: Object reference not set to an instance of an object. at 
ToSic.Sxc.Edit.EditService.EditService.ConnectToRoot(IDynamicCodeRoot codeRoot) in 
C:\Projects\2sxc\2sxc\Src\Sxc\ToSic.Sxc\Edit\EditService\EditService.cs:line 26 at 
ToSic.Sxc.Blocks.RenderService.GetEditService(IBlock blockOrNull) in 
C:\Projects\2sxc\2sxc\Src\Sxc\ToSic.Sxc\Blocks\Renderers\RenderService.cs:line 174 at 
ToSic.Sxc.Blocks.RenderService.All(ICanBeItem parent, String noParamOrder, String field, String apps, Int32 max, 
String merge) in C:\Projects\2sxc\2sxc\Src\Sxc\ToSic.Sxc\Blocks\Renderers\RenderService.cs:line 143 at 
ToSic.Sxc.Blocks.Render.All(DynamicEntity parent, String noParamOrder, String field, String apps, Int32 max, String 
merge) in C:\Projects\2sxc\2sxc\Src\Dnn\ToSic.Sxc.Dnn.Core\Compatibility\Sxc\ToSic.Sxc.Blocks.Render.cs:line 65 at 
System.Dynamic.UpdateDelegates.UpdateAndExecute4[T0,T1,T2,T3,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 
arg3) at ASP._Page_Portals_0_2sxc_News4_CUA__News__Details_cshtml.Execute() in 
C:\HostingSpaces\CUA\cuaerospace.com\www\Portals\0\2sxc\News4\CUA\_Details.cshtml🎯:line 68 at ...

and lines 67-69 are:

    <div class="app-news-detail-body">
      @ToSic.Sxc.Blocks.Render.All(article, field: "InnerContent", merge: article.Content)
    </div>
  • 2sxc version(s): 16.09.00 and v17.00.00
  • Browser: all/any
  • DNN: v9.6.1 to 9.13.01
  • Hosting platform: all/any; IIS
@jeremy-farrance
Copy link
Author

Also, I then cont'd and installed 2sxc v17.00.00. Saw the message about needing Libraries/CodeDom 3.6, installed that.

List View displays fine.

Rolled backs Details to .code.cshtml version, same errors as above: error 1, workaround, error 2.

@iJungleboy
Copy link
Contributor

fixed in next release today or tomorrow.

@github-project-automation github-project-automation bot moved this to Done in 2sxc 17 Jan 17, 2024
@iJungleboy iJungleboy moved this from Done to v17.01 in 2sxc 17 Jan 18, 2024
@jeremy-farrance
Copy link
Author

jeremy-farrance commented Jan 18, 2024

Excellent! Tested on v17.01.00 and its working!! Thank you.

@iJungleboy
Copy link
Contributor

@jeremy-farrance you're welcome
and thanks for reporting it! really appreciate this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: v17.01
Development

No branches or pull requests

2 participants