Open james7342 opened 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!
Let me try that. This is the first time trying to use the module. Looks like maybe I shouldn't have. :-)
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 :)
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.
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):
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.
It sounds like you could even just use any structured template solution that allows you to have and run Razor. No module required.
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.
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.
@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.
@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!
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.
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?
I think these are still real issues with this module, so go ahead and leave it open. Thanks!
Description of bug Trying to use the Module Creator 9.8.1 to make quick test module.
Steps to reproduce
Current behavior Error Message
Expected behavior Install Package is created
Screenshots
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
[ ] 10.00.00 alpha build
[ ] 09.09.00 release candidate
[X] 09.08.01 latest supported release
[ ] Chrome
[ ] Firefox
[ ] Safari
[ ] Internet Explorer 11
[ ] Microsoft Edge (Classic)
[X] Microsoft Edge Chromium
Originally open for DNN Platform. https://github.com/dnnsoftware/Dnn.Platform/issues/4496