DNNCommunity / Dnn.ModuleCreator

Dnn Module Creator Module
MIT License
5 stars 2 forks source link

Module Creator Errors on Configure and Create Package #16

Open james7342 opened 3 years ago

james7342 commented 3 years ago

Description of bug Trying to use the Module Creator 9.8.1 to make quick test module.

Steps to reproduce

  1. Create Page
  2. Place Module Creator Module on Page
  3. Provide required information to create a module. (C#, User-Control)
  4. Module is added to page.
  5. Click module gear icon and select develop.
  6. Click create package
  7. Receive Error message - "A critical error has occurred. Please check the Admin Logs for further details."

Current behavior Error Message

Expected behavior Install Package is created

Screenshots 107988460-ebf4fe80-6f84-11eb-8aa9-a1d83050ecd2

Error information AbsoluteURL:/Default.aspx DefaultDataProvider:DotNetNuke.Data.SqlDataProvider, DotNetNuke ExceptionGUID:57bfa4bf-fc12-48c4-930a-dfe681c2fbc2 AssemblyVersion:9.8.1 PortalId:0 UserId:1 TabId:1106 RawUrl:/Testing-Pages/User-Reg-Expired/ctl/ViewSource/ModuleId/1451/ctlid/303?ReturnURL=/Testing-Pages/User-Reg-Expired&popUp=true Referrer:http://dnndev.me/Testing-Pages/User-Reg-Expired/ctl/ViewSource/ModuleId/1451/ctlid/303?ReturnURL=/Testing-Pages/User-Reg-Expired&popUp=true UserAgent:Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36 Edg/88.0.705.68 ExceptionHash:eP6xokbN5rU4oR+vp4/9NDeAwbE= Message:Object reference not set to an instance of an object. StackTrace: InnerMessage:Object reference not set to an instance of an object. InnerStackTrace: at Dnn.Module.ModuleCreator.ViewSource.OnPackageClick(Object sender, EventArgs e) at System.Web.UI.WebControls.LinkButton.OnClick(EventArgs e) at System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument) at System.Web.UI.Page.d__523.MoveNext() Source: FileName: FileLineNumber:0 FileColumnNumber:0 Method: Server Name: DESKTOP-ITGOR02

Originally open for DNN Platform. https://github.com/dnnsoftware/Dnn.Platform/issues/4496

bdukes commented 3 years ago

It seems like this is coming from https://github.com/DNNCommunity/Dnn.ModuleCreator/blob/develop/viewsource.ascx.cs#L531

This module is expecting there to be an Extensions module, and it's "borrowing" its package writer utility. Unfortunately, that module was removed with the transition to the Persona Bar, so I don't think this functionality has worked for a long time.

A similar approach now would be to use the Extensions page in the Persona Bar, but there's not a way to deep link into that section of the Persona Bar (I know that the edit bar does deep linking into the Pages Persona Bar extension, so it's possible, but there's not a general-purpose method for doing it AFAIK).

In the short term, we'd point you to use the functionality within the Extensions Persona Bar page. In terms of fixing this issue in the Module Creator, I'd lean towards removing the functionality (perhaps replace it with a note to use the Persona Bar?). I don't think it's worth the effort to make a more elaborate solution (though if someone did want to invest time in that, I don't think we'd be opposed).

Thanks so much for testing and reporting this issue! Hope it helps!

james7342 commented 3 years ago

Let me try that. This is the first time trying to use the module. Looks like maybe I shouldn't have. :-)

valadas commented 3 years ago

I join my voice to @bdukes if any PR comes in for this, I'd be glad to review/merge. We extracted this module from the platform as we did not know many people using it and it was a bit less maintained than it should be :) So it's here if people want to keep maintaining it and we are here to help if that is the case :)

valadas commented 3 years ago

I redid the whole build process on this module so if anyone does want to contribute and is confused, just ping me up and I'll be glad to help.

bdukes commented 3 years ago

I wouldn't suggest using this module to create new modules that you expect to maintain, I would point you to one of the module templates for that. However, I do use this module fairly often when testing, to be able to quickly try out an API.

In terms of module templates, you can check out some of these (I thought we had a more official list, but I'm having trouble finding it):

james7342 commented 3 years ago

Yeah. I was looking for something quick and easy. I have Chris Hammond's templates already. A little overkill for what I was trying to do. I'm just trying to create a quick module that can check a User Role Expiration date and display a message that it's expired. I/we set an expiration date on Registered User role for when their membership expires. Basically a couple lines of code is all I needed and trying to learn/play with module creation.

WillStrohl commented 3 years ago

It sounds like you could even just use any structured template solution that allows you to have and run Razor. No module required.

james7342 commented 3 years ago

And it appears the Create new Module on the Extension page just pulls the Module Creator. Tested that for the fun of it and it looks to create a module on the page. Click the Edit/Develop option. Click configure or create package with the same error.

screenshot_2007

AbsoluteURL:/Default.aspx DefaultDataProvider:DotNetNuke.Data.SqlDataProvider, DotNetNuke ExceptionGUID:fbfee1c4-1f3e-4d99-8ead-aebe2377474e AssemblyVersion:9.8.1 PortalId:0 UserId:1 TabId:55 RawUrl:/Home/ctl/ViewSource/ModuleId/2454/ctlid/1304?ReturnURL=/&popUp=true Referrer:http://dnndev.me/Home/ctl/ViewSource/ModuleId/2454/ctlid/1304?ReturnURL=/&popUp=true UserAgent:Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36 Edg/88.0.705.68 ExceptionHash:eP6xokbN5rU4oR+vp4/9NDeAwbE= Message:Object reference not set to an instance of an object. StackTrace: InnerMessage:Object reference not set to an instance of an object. InnerStackTrace: at Dnn.Module.ModuleCreator.ViewSource.OnPackageClick(Object sender, EventArgs e) at System.Web.UI.WebControls.LinkButton.OnClick(EventArgs e) at System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument) at System.Web.UI.Page.d__523.MoveNext()

james7342 commented 3 years ago

@hismightiness I'm thinking I might just try to move to a Razor script to do what I want. I just thought I would try something new as learning opt.

david-poindexter commented 3 years ago

@james7342 you can also use dnn-cli to scaffold out a quick module type of your preference based on the starter-module-* projects on the DNN Community GitHub org.

Also, there's generator-upendodnn that can help with scaffolding out various module projects.

Good luck!

james7342 commented 3 years ago

Got it migrated over to Razor. It's all working at the moment just working through a "Object reference not set to an instance of an object" that i just noticed popping up in the admin log. Even though it appears to be working fine. Will look at that more tomorrow.

james7342 commented 3 years ago

I was able to create what I needed using the Razor module. Not sure what to do with this issue. Should it be closed or leave it open?

bdukes commented 3 years ago

I think these are still real issues with this module, so go ahead and leave it open. Thanks!