DNNCommunity / DNN.Events

DNN Events manages display of upcoming events as a list in chronological order or in calendar format with additional information. This Github repo is used for source management and releases.
MIT License
27 stars 40 forks source link

Critical Error - Updating Settings #209

Closed HZass closed 4 years ago

HZass commented 4 years ago

Describe the bug

The bug manifests itself on a clean installation of Events 7.0.4 onto DNN 8.0.4 when you attempt to make selection changes to either Locations. The error reflected is: Error: VWC Event Schedule is currently unavailable. DotNetNuke.Services.Exceptions.ModuleLoadException: Specified cast is not valid. ---> System.InvalidCastException: Specified cast is not valid. at DotNetNuke.Modules.Events.SelectLocation.get_SelectedLocation() at DotNetNuke.Modules.Events.EventMonth.BindDataGrid() at DotNetNuke.Modules.Events.EventMonth.Page_Load(Object sender, EventArgs e) --- End of inner exception stack trace ---

To Reproduce

Steps to reproduce the behavior:

  1. Install a clean version of EVENTS module into DNN Release 8.0.4 site
  2. Attempt to make changes to categories and locations from drop-down menus
  3. Select Update Button
  4. Receive the error message and the setting as not updated.

Expected behavior

A clean update to the Settings for the events. Make changes to the settings for a location Select Update Review the display with changed settings Notice that the correct location and/or category is being displayed Select Settings and note that the previous changes are being displayed

Screenshots

If applicable, add screenshots to help explain your problem.

Error log

Note: Debug DLL's Please replace the current extension DLL's with the debug DLL's (if these are available with the release) and reproduce the error with the debug DLL's before pasting the error log.

Paste the error log that is related to this issue.

Additional context

Add any other context about the problem here.

HZass commented 4 years ago

Updated Error Log with Debug statements: Error: VWC Event Schedule is currently unavailable. DotNetNuke.Services.Exceptions.ModuleLoadException: Specified cast is not valid. ---> System.InvalidCastException: Specified cast is not valid. at DotNetNuke.Modules.Events.SelectLocation.get_SelectedLocation() in C:\DDrive\Develop\GitHub\DNN.Events\SubControls\SelectLocation.ascx.cs:line 122 at DotNetNuke.Modules.Events.EventMonth.BindDataGrid() in C:\DDrive\Develop\GitHub\DNN.Events\EventMonth.ascx.cs:line 167 at DotNetNuke.Modules.Events.EventMonth.Page_Load(Object sender, EventArgs e) in C:\DDrive\Develop\GitHub\DNN.Events\EventMonth.ascx.cs:line 113 --- End of inner exception stack trace ---

HZass commented 4 years ago

Closed in error .....

thabaum commented 4 years ago

DNN.Events 07.00.01 will work for any DNN version 8.0.1 and up. This is a bug fix release of the DNN.Events

I see this is a version that should be supported. Do any of the previous version 7 of DNN Events releases cause the same error? Maybe this can lead to some clues if you can check into a version where this feature still works.

Also any specifics that may differ in installation or just a clean install of DNN 8.04? Anything to reproduce related to DNN Events Module and changes to a configuration of your site such as using multiple languages. This may then relate to a prior error that is currently known.

EPTamminga commented 4 years ago

Please try a later version of DNNEvents: 07.00.04. There were several issues with casting in some situations due to the conversion from VB.net to C#.

thabaum commented 4 years ago

The bug manifests itself on a clean installation of Events 7.0.4 onto DNN 8.0.4 when you attempt to make

I believe the error he is having trouble with is from current version 7.0.4

HZass commented 4 years ago

The error manifests itself under the following condition:

  1. Choose settings
  2. Note that the location is set to All and the module works correctly. However, we have multiple schedules, each under different editing control on separate pages. Thus, we need to select the location(s) that apply to a specific schedule.
  3. If you choose say, three out of 5 location settings. When the program completes the updating cycle two things to notice: a. NO events are displayed for that schedule b. The settings are NOT updated.
  4. The same condition is manifested with the selection of categories for a specific schedule.

This is not critical, as such, as each instance of the events schedule is identified with a specific ModuleID. However, we are not able to have our users choose the event locations/categories that they are interested in, as this selection always results in a blank schedule,

HZass commented 4 years ago

Please try a later version of DNNEvents: 07.00.04. There were several issues with casting in some situations due to the conversion from VB.net to C#.

I was not aware that there is a later version of DNNEvents.

thabaum commented 4 years ago

I would say the only way to duplicate is to install DNN 8.0.4 and the latest version of DNN Events 7.0.4 It sounds like you have the latest version.

This may be something specific to that version of DNN. I may have confused with my quote as I was quoting from the DNN 7.0.1 version that it should work with 8.0.1 and above so this is what the version the module is compiled on to allow it to work with that version I believe. I meant to quote this however from the latest release notes:

DNN.Events 07.00.04 will work for any DNN version 8.0.1 and up to the latest release of DNNPlatform

This is a bit more information thank you.

From what I understand.

Are the modules sub-modules to a master event calendar?

There maybe an issue in the code could be found if the option for "All Locations" setting works it can give a clue to what may be missing not allowing the database to update the fields with the event information.

One last question is does the error occur when you select one location? Or only when multiple are selected?

HZass commented 4 years ago

The settings for a specific Event Module instance are not updated for selected locations/categories. The event records are correctly identified, created and updated. The effect of this issue is in the generation of the display.

Looking at the code, this is all moot if ALL of the locations or categories are selected from the drop down menu, as all events are correctly displayed.

HZass commented 4 years ago

Oh .. there are no sub modules to a master module. This condition is displayed is any selection is made from either Location Or Category drop down selection menus in the Settings panel.

HZass commented 4 years ago

The following is the error message I receive when I use the debug DLLs and modifications to the web configuration file: Error: VWC Event Schedule is currently unavailable. DotNetNuke.Services.Exceptions.ModuleLoadException: Specified cast is not valid. ---> System.InvalidCastException: Specified cast is not valid. at DotNetNuke.Modules.Events.SelectLocation.get_SelectedLocation() in C:\DDrive\Develop\GitHub\DNN.Events\SubControls\SelectLocation.ascx.cs:line 99 at DotNetNuke.Modules.Events.EventMonth.BindDataGrid() in C:\DDrive\Develop\GitHub\DNN.Events\EventMonth.ascx.cs:line 167 at DotNetNuke.Modules.Events.EventMonth.Page_Load(Object sender, EventArgs e) in C:\DDrive\Develop\GitHub\DNN.Events\EventMonth.ascx.cs:line 113 --- End of inner exception stack trace ---

In this case the settings are correctly updated; however, there are no events displayed and the above error message is display at the bottom of the monthly event schedule display.

EPTamminga commented 4 years ago

@HZass I found the problem (cast error due to VB.net to C# conversion). I did take some time since this was related to filter settings of sub-calendars. Your 2nd explanation got me on track for reproducing the error. I will include the fix in 07.00.05

HZass commented 4 years ago

I was also looking at the code and found that when I changed the cast of element on line 99 of the SelectLocation.ascx.cs file to read as follows: foreach (object location in Settings.ModuleLocationIDs) When I recompiled the module and tested the installation as above, the error was corrected.

EPTamminga commented 4 years ago

I applied VAR, and I found 1 other line where I had to do the same.

Tnx for the feedback and patience.

EPTamminga commented 4 years ago

Fixed in Events 07.00.05, available as (pre) release