Coder Social home page Coder Social logo

Comments (41)

EPTamminga avatar EPTamminga commented on September 2, 2024 3

@james7342
Tnx for testing., I think I see what I have to change more.
I will try to set up a better test cycle (similar to yours), so I can verify it myself before bothering others :-)

More tomorrow.

from dnn.events.

EPTamminga avatar EPTamminga commented on September 2, 2024 2

I am still on it, but due to work and some private matters, I could not allocate time to do the requires changes and testing.
It is on my list...

from dnn.events.

bdukes avatar bdukes commented on September 2, 2024 1

@EPTamminga so you're saying that while it didn't error before DNN 9.8.0, it didn't store a meaningful value, right? So, it was never storing the list of IDs that you wanted it to store.

You have two options to get the serialization manager to handle a custom type like ArrayList. First, you can move it to a property which has the string value and parse it manually when you need it. This is the strategy used by the ModuleCategoryIDs setting:

public ArrayList ModuleCategoryIDs
{
get
{
if (ReferenceEquals(_moduleCategoryIDs, null))
{
var arCat = new ArrayList();
arCat.Add(ModuleCategoryID);
_moduleCategoryIDs = arCat;
}
return _moduleCategoryIDs;
}
set { _moduleCategoryIDs = value; }
}
[ModuleSetting(ParameterName = "ModuleCategoryIds")]
public string ModuleCategoryIdsList
{
get { return string.Join(";", ModuleCategoryIDs ?? new ArrayList()); }
set
{
ModuleCategoryIDs = !string.IsNullOrWhiteSpace(value)
? new ArrayList(
value.Split(new[] {";"}, StringSplitOptions.RemoveEmptyEntries)
.Select(arg => arg)
.ToArray())
: new ArrayList();
}
}

The second option it to specify a custom serializer in the ModuleSetting attribute. The Serializer property of the attribute can be set to the name of a type that implements ISettingsSerializer<ArrayList>, and then that class will be called to translate to and from string when interacting with the settings table.

from dnn.events.

EPTamminga avatar EPTamminga commented on September 2, 2024 1

@bdukes Tnx for the suggestions.

What is was trying to say that it did work before DNN980. I will implement the change like the CategoryID's.

from dnn.events.

EPTamminga avatar EPTamminga commented on September 2, 2024 1

@james7342 You are right. I did not restart the site while testing myself.

from dnn.events.

james7342 avatar james7342 commented on September 2, 2024 1

Ernst, I think you might have got it.

Starting Environment:
DNN 9.7.2
Events 7.0.6

Test Setup:
Events Module on Page
Create 2 Locations via Edit Locations (Test1, Test2)
Create 3 Test Events
2 with the locations assigned (Test1, Test2)
1 with no Location

Test Case 1:
Adjust Module Filter Location (Events/Edit Setting/Filter Events by Location)
Set Module Filter to Test1, Load Page, Only Test1 Events displayed
Set Module Filter to Test2, Load Page, Only Test2 Events displayed
Set Module Filter to All, Load Page All Events displayed
Everything works as expected

Test Case 2:
Upgrade to DNN 9.8.1
Verified page Load Failure
Run Delete SQL statement in Host/DNN SQL Console
Page still had error message
Restart Application - Host/Servers - Critical in order for the page to load properly
Page loads without error
Copy Test DLL files in to Root/Bin Folder (Events707TestDLL.zip)
Restart Application - Host/Servers - Critical in order for the page to load properly
Verify page still loads without error on new DLL's
Adjust Module Filter Location (Events/Edit Setting/Filter Events by Location)
Set Module Filter to Test1, Load Page, Only Test1 Events displayed
Set Module Filter to Test2, Load Page, Only Test2 Events displayed
Set Module Filter to All, Load Page All Events displayed
Everything Works as expected

Test Case 3:
Restart Application - Host/Servers - Just to perform additional reset
Verify page still loads without error
Adjust Module Filter Location (Events/Edit Setting/Filter Events by Location)
Set Module Filter to Test1, Load Page, Only Test1 Events displayed
Set Module Filter to Test2, Load Page, Only Test2 Events displayed
Set Module Filter to All, Load Page All Events displayed
Everything Works as expected

Test Case 4:
Restart Dev/Test PC Virtual Machine
Verify page still loads without error
Adjust Module Filter Location (Events/Edit Setting/Filter Events by Location)
Set Module Filter to Test1, Load Page, Only Test1 Events displayed
Set Module Filter to Test2, Load Page, Only Test2 Events displayed
Set Module Filter to All, Load Page All Events displayed
Everything Works as expected

from dnn.events.

MaiklT avatar MaiklT commented on September 2, 2024

I can confirm this.

After installing the debug assemblies I got the following in the inner stack trace:

at Components.EventModuleSettings.CreateEventModuleSettings(Int32 moduleId, String localResourceFile) in C:\DDrive\Develop\GitHub\DNN.Events\Components\EventModuleSettings.cs:line 247
at Components.EventModuleSettings.GetEventModuleSettings(Int32 moduleID, String localResourceFile) in C:\DDrive\Develop\GitHub\DNN.Events\Components\EventModuleSettings.cs:line 101
at Components.EventBase.get_Settings() in C:\DDrive\Develop\GitHub\DNN.Events\Components\EventBase.cs:line 1378
at Components.EventBase.GetThemeSettings() in C:\DDrive\Develop\GitHub\DNN.Events\Components\EventBase.cs:line 475
at Components.EventBase.SetTheme(Panel ctlPnlTheme) in C:\DDrive\Develop\GitHub\DNN.Events\Components\EventBase.cs:line 422
at DotNetNuke.Modules.Events.Events.Page_Load(Object sender, EventArgs e) in C:\DDrive\Develop\GitHub\DNN.Events\Events.ascx.cs:line 591
at System.Web.UI.Control.OnLoad(EventArgs e)
[....]

It looks like that loading the theme causes the issue.

I tried uninstalling the module, and after re-installing it it worked fine, but I had to go back to 9.7.2 not to lose the events.

from dnn.events.

EPTamminga avatar EPTamminga commented on September 2, 2024

Something strange with the modulesettings?

from dnn.events.

MaiklT avatar MaiklT commented on September 2, 2024

Nothing special, afair. Would a list of all ModuleSettings be helpful?

BTW: It happened on two different sites, both of them have an instance of the module (these are all sites that I have that use the module). There is no master calendar or anything. Both portals have only one language activated (de-AT),

I installed DNN 9.7.2 (blank site template) in a testing environment, activated de-AT and deactivated en-US. I installed the Core Resource Pack (de-AT), Events 07.00.06 and the de-AT resource pack. Then I placed an instance of the Event module on the start page. There were just a few settings to change to make it work (Email addresses, timezone - note: I did not change anything else!), then I added some events,

Then I upgraded to DNN 9.8.0 - and the error was there.

So it is easy to reproduce.

from dnn.events.

james7342 avatar james7342 commented on September 2, 2024

I didn't spend much time on it due to 9.8.0 being pretty new. When I tested I believe I got the same error. I restored the site back to 9.7.2 and really didn't do much troubleshooting.

from dnn.events.

MaiklT avatar MaiklT commented on September 2, 2024

Just tried to upgrade a site from DNN 9.6.1 to 9.8.0 - same problem. Here I have a "master" calendar that includes three sub calendars. The only one that works is the sub-calendar that does not have a single event (lazy editor :-))

from dnn.events.

MaiklT avatar MaiklT commented on September 2, 2024

Set up a DNN 9.7.2 website (blank template), just added the Events Module, I placed it on the start page, set the timezone and the email addresses and added an event. Upgraded to 9.8.0 -> Error. So this is no localization issue.

Did the same without adding an event, and without changing any setting (just went into settings, and clicked update). Then upgraded to DNN 9.8.0. No error, Could add an event as well.

from dnn.events.

EPTamminga avatar EPTamminga commented on September 2, 2024

The serialization in DNN980 has changed on several points from previous DNN versions causing a breaking error:

DotNetNuke.Entities.Modules.Settings.SerializationManager.DotNetNuke.Abstractions.ISerializationManager.DeserializeProperty[T](T myObject, PropertyInfo property, String propertyValue, String serializer)
at DotNetNuke.Entities.Modules.Settings.SettingsRepository1

I did not have time yet to see how this can be fixed.

from dnn.events.

brewadmin avatar brewadmin commented on September 2, 2024

I get the same error (Message:Could not cast System.Collections.ArrayList to property ModuleLocationIDs of type System.Collections.ArrayList
StackTrace:
at DotNetNuke.Entities.Modules.Settings.SerializationManager.DotNetNuke.Abstractions.ISerializationManager.DeserializeProperty[T](T myObject, PropertyInfo property, String propertyValue, String serializer) ... after upgrade to DNN 9.8.

from dnn.events.

EPTamminga avatar EPTamminga commented on September 2, 2024

@brewadmin Yes, I know, it is a result of the changed Settings routines in DNN980. I still have to see what has to be changed...

from dnn.events.

brewadmin avatar brewadmin commented on September 2, 2024

from dnn.events.

blair260 avatar blair260 commented on September 2, 2024

Has anyone discovered a fix for this? We had a ransomeware attack on our server and have been forced to upgrade to 9.8 and now the events module doesn't work. I've looked at the code, but I can't see the failure. Any thoughts on how to get this working?

from dnn.events.

EPTamminga avatar EPTamminga commented on September 2, 2024

I think the error is related to a change in DNN980 in serialization:
dnnsoftware/Dnn.Platform#4312
I did not find the time yet to dig deeper into the problem.

from dnn.events.

james7342 avatar james7342 commented on September 2, 2024

I was thinking it was more related to this change. dnnsoftware/Dnn.Platform#4087

But I could be wrong. I to tried looking at the code to see if I could figure it out. I don’t have a proper DNN development environment setup so was unable to follow the DNN source code. I was able to install the symbols and could see which lines of code being reported. That was about it though.

from dnn.events.

EPTamminga avatar EPTamminga commented on September 2, 2024

@james7342 I think you are right.

I will try to allocate some time tomorrow to have a serious look since the problem irritates me :-(

from dnn.events.

bdukes avatar bdukes commented on September 2, 2024

The error is coming from the ModuleLocationIDs property in the settings, which is an ArrayList, but is marked as a ModuleSetting. Without a custom serializer specified, there's no way for this property to be serialized and deserialized correctly. I'm guessing that the error was silently ignored before the change in 9.8.0, but I don't see that it was doing anything useful with this field prior to 9.8.0. If you remove the ModuleSetting attribute, does that resolve the issue?

[ModuleSetting]
public ArrayList ModuleLocationIDs
{
get
{
if (ReferenceEquals(_moduleLocationIDs, null))
{
var arLoc = new ArrayList();
arLoc.Add(ModuleLocationID);
_moduleLocationIDs = arLoc;
}
return _moduleLocationIDs;
}
set { _moduleLocationIDs = value; }
}

from dnn.events.

james7342 avatar james7342 commented on September 2, 2024

That looks like it fixes it. I created a DNN 9.7.2 instance. Installed Events 7.0.6 and placed module on page. Changed some random settings and created a single test event. Upgraded to DNN 9.8.1 and verified the issue. Created a fork of the project and just commented out the line 414. Rebuilt the project and installed the module (Repair Installation). Loaded the page and the calendar loaded without error. Since I'm not an everyday developer and not sure what other possible issues might happen with this change I'll let someone smarter than me do the actual code change and commit. But playing with this in my little slice of the world appears to have resolved it. Looks like maybe this was just an errant line.

//[ModuleSetting]
public ArrayList ModuleLocationIDs
{
get
{
if (ReferenceEquals(_moduleLocationIDs, null))
{
var arLoc = new ArrayList();
arLoc.Add(ModuleLocationID);
_moduleLocationIDs = arLoc;
}
return _moduleLocationIDs;
}
set { _moduleLocationIDs = value; }
}

from dnn.events.

EPTamminga avatar EPTamminga commented on September 2, 2024

@bdukes Tnx for having a look. I need to see if the ModuleSettings is a result of VB,net->C# conversion some releases ago.
I know I had the idea to have a look 2 days ago, but time flies when you need to do "normal" work from home in Corona times...

from dnn.events.

EPTamminga avatar EPTamminga commented on September 2, 2024

I have looked into it somewhat further. The code is from serious time back.

The list of locations should be saved in the module settings since the module can limit the locations that are available for events in a particular module instance.

Commenting out the line [ModuleSettings] is not the solution (yes, it is the solution to circumvent the error, but does not enable saving the settings for location id's).

I have to look a bit further to make it without error.

Frustrating is that it did work correctly pre DNN980, the setting stored = a "System.Collections.Arraylist"

from dnn.events.

blair260 avatar blair260 commented on September 2, 2024

Thanks guys - good stuff here and that makes sense. I appreciate everyone jumping in to make this compatible with DNN 9.8!

from dnn.events.

maduranga001 avatar maduranga001 commented on September 2, 2024

I am having the same issue. I upgraded to DNN 9.8.1 and updated the Events module to 7.0.6 version. The module is loading with an error and the page is breaking.

Please can you advise how to fix this? I a using the installable PA version of the Events module.

from dnn.events.

MaiklT avatar MaiklT commented on September 2, 2024

@maduranga001 To fix this at the moment you have the following possibilities:

  1. Stay on DNN 9.7.2 until an upgrade of the Events module is available.
  2. Create a fork, fix the issue and start a pull request.

As we see in Brian's and Ernst Peter's post above, a solution should be near...

from dnn.events.

maduranga001 avatar maduranga001 commented on September 2, 2024

Thank you @malikt
Actually, now we have already upgraded to DNN 9.8.1 and we have to stay with it. So I have to wait for the new release.

@maduranga001 To fix this at the moment you have the following possibilities:

  1. Stay on DNN 9.7.2 until an upgrade of the Events module is available.
  2. Create a fork, fix the issue and start a pull request.

As we see in Brian's and Ernst Peter's post above, a solution should be near...

from dnn.events.

EPTamminga avatar EPTamminga commented on September 2, 2024

Testing and verification

I just installed a clean DNN981, installed a clean Events706 and did not find any error...
It works as expected, including a limitation for a category and/or a location in the module settings with no errors.

I installed the Events706 on a clean DNN972, created events, no problem.
Created an addition module instance in a separate page and used a limitation in category and location.
In DNN972, no problem. I upgraded to DNN981. The events module that did not have a limitation on location and category had no problem, the instance that had the limitation, did have the error.

Hotfixing the problem

By deleting (by SQL) the modulesettings table that limits the category and/or location, I can make the module work again. The only negative effect is that you have to reapply the limits on categories and/or locations in the module settings, because those limitations are removed by the SQL statement.

Hotfix

The SQL statement (to be used from the SQL console in the Host) is:

DELETE  FROM {databaseOwner}[{objectQualifier}ModuleSettings]
WHERE   ModuleID IN
        (
            SELECT DISTINCT MS.ModuleID
            FROM   {databaseOwner}[{objectQualifier}ModuleSettings] AS MS
                INNER JOIN {databaseOwner}[{objectQualifier}Modules] AS MO 
				    ON MO.ModuleID = MS.[ModuleID]
                INNER JOIN {databaseOwner}[{objectQualifier}ModuleDefinitions] AS MD
                    ON MD.ModuleDefID = MO.ModuleDefID
            WHERE MD.DefinitionName = 'Events'
        )
        AND [ModuleSettings].SettingName LIKE 'Module%Ids';

Events707

In the Events707 update, I will implement this delete statement, so the upgrade will also remove the settings since I see no option to upgrade the settings.

Verification?

I would be more than happy if people here could verify the solution I listed here.
@MaiklT @maduranga001 @djamell @blair260 @james7342 @brewadmin Any of you willing to test it in your scenario?

New version in the works

In the meantime, I will change the locationId's settings as mentioned by @bdukes

from dnn.events.

james7342 avatar james7342 commented on September 2, 2024

@EPTamminga
Performed the below tests. The workaround is short lived. Once the application is restarted the error returns on page load.

Environment:
DNN 9.7.2
Events 7.0.6

Test Setup:
Events Module on Page
Create 2 Locations via Edit Locations (Test1, Test2)
Create 3 Test Events
2 with the locations assigned (Test1, Test2)
1 with No Location

Test Case 1:
Adjust Module Filter Location (Events/Edit Setting/Filter Events by Location)
Set Module Filter to Test1, Load Page, Only Test1 Events displayed
Set Module Filter to Test2, Load Page, Only Test2 Events displayed
Set Module Filter to All, Load Page All Events displayed
Everything works as expected

Test Case 2:
Upgrade to DNN 9.8.1
Verified page Load Failure
Ran Delete SQL statement in Host/DNN SQL Console
Page still had error message
Restart Application - Host/Servers - Critical in order for the page to load properly
Page Loads without Error
Adjust Module Filter Location (Events/Edit Setting/Filter Events by Location)
Set Module Filter to Test1, Load Page, Only Test1 Events displayed
Set Module Filter to Test2, Load Page, Only Test2 Events displayed
Set Module Filter to All, Load Page All Events displayed
Everything Works as expected

Test Case 3:
Restart Application - Host/Servers
Page Load Failure same error
Failure

Let me know of you want me to do any further testing. I run my test environment in VMware and create snapshots before I do anything. Easy restore back to starting point.

from dnn.events.

EPTamminga avatar EPTamminga commented on September 2, 2024

@james7342 In your test environment: update the bin with the following files, but DO clean the settings with the SQL first.

EVents707DLL.zip

from dnn.events.

maduranga001 avatar maduranga001 commented on September 2, 2024

Thank you very much.
If I try the above solution for now, how do we use the next new version? Do you have the solution to replace before we install the newer version?

from dnn.events.

EPTamminga avatar EPTamminga commented on September 2, 2024

@maduranga001 First of all, do not use the above things in a production environment. They are just for testing purposes here.

I will create a new version (Events 7.0.7, that will handle all the update stuff, with one exception: if you have used the locations and/or category limitations in the module settings, you have to reapply them after installing the new version.
I will try to limit the update to the location settings, but I have to do some testing first..

from dnn.events.

james7342 avatar james7342 commented on September 2, 2024

@EPTamminga

Different error this time, but still a failure after restarting application.

Test Setup:
DNN981
Event706

Test Case 1:
Confirm page load failure
Run Delete SQL statement in Host/DNN SQL Console
Copy Test DLL files in to Root/Bin Folder (EVents707DLL.zip)
Restart Application - Host/Servers
Page Load without error
Adjust Module Filter Location (Events/Edit Setting/Filter Events by Location)
Set Module Filter to Test1, Load Page, Only Test1 Events displayed
Set Module Filter to Test2, Load Page, Only Test2 Events displayed
Set Module Filter to All, Load Page, All Events displayed
Everything works as expected

Test Case 2:
Restart Application - Host/Servers
Page Loads with error - Though different error message then prior and no Events shown.

Error: Events is currently unavailable. DotNetNuke.Services.Exceptions.ModuleLoadException: Input string was not in a correct format. ---> System.FormatException: Input string was not in a correct format. at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info) at System.String.System.IConvertible.ToInt32(IFormatProvider provider) at Components.EventModuleSettings.get_ModuleLocationsSelected() in C:\DDrive\Develop\GitHub\DNN.Events\Components\EventModuleSettings.cs:line 454 at DotNetNuke.Modules.Events.SelectLocation.get_SelectedLocation() in C:\DDrive\Develop\GitHub\DNN.Events\SubControls\SelectLocation.ascx.cs:line 119 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 ---

screenshot_1923

from dnn.events.

blair260 avatar blair260 commented on September 2, 2024

@EPTamminga and @james7342 - has anyone had any luck with getting this to work? I tried with the build but keep getting the same, or something similar, error. What are you guys thinking? Thanks for all the help here! - Sam

from dnn.events.

james7342 avatar james7342 commented on September 2, 2024

@blair260- Nothing is fixed yet in code and the potential workaround doesn’t work long term. Ernst was going to do some more work on it, but I’m sure the day job might be getting in the way. Anyone running the module should hold off on upgrading to DNN 9.8.X at this point until it’s resolved.

from dnn.events.

EPTamminga avatar EPTamminga commented on September 2, 2024

I could finally allocate time to have a new round on the error.

Do not do the following things on a production site!

The instruction is for testing purposes only!

Instruction for validation

The instruction below can be executed on an upgraded site (DNN980 or DNN981) that has DNNEvents 7.0.6 installed and produces the error.

Run the following SQL statement in the Host/SQL option, to clear out the setting that causes the error (you will lose the location limitation setting in the module settings, but that has to go)

DELETE  FROM {databaseOwner}[{objectQualifier}ModuleSettings]
WHERE   ModuleID IN
        (
            SELECT DISTINCT MS.ModuleID
            FROM   {databaseOwner}[{objectQualifier}ModuleSettings] AS MS
                INNER JOIN {databaseOwner}[{objectQualifier}Modules] AS MO 
				    ON MO.ModuleID = MS.[ModuleID]
                INNER JOIN {databaseOwner}[{objectQualifier}ModuleDefinitions] AS MD
                    ON MD.ModuleDefID = MO.ModuleDefID
            WHERE MD.DefinitionName = 'Events'
        )
        AND [ModuleSettings].SettingName = 'ModuleLocationIds';

Unzip the files in the attached zip en copy (overwrite) them in the bin folder of the site.
Events707TestDLL.zip

Things should work now without error.

Please provide feedback

@MaiklT @maduranga001 @djamell @blair260 @james7342 @brewadmin Any of you available to do some testing?

If I get confirmation on success, I will create a new DNNEvents release

from dnn.events.

EPTamminga avatar EPTamminga commented on September 2, 2024

@james7342 Thank you for your feedback!

from dnn.events.

brewadmin avatar brewadmin commented on September 2, 2024

from dnn.events.

MaiklT avatar MaiklT commented on September 2, 2024

@brewadmin There is already an issue (#85) about this.

from dnn.events.

EPTamminga avatar EPTamminga commented on September 2, 2024

I have created an update (07.00.07) that should solve the problem.

I have to some additional research, because I have the idea that the default filtering on categories and/or locations in the module settings are not saved on restarts. If you do not use this setting (most users do not use this particular filtering), you do not have to worry.
I will combine this with the removal of the Telerik controls that are used for these sestings (multi select combobox).

from dnn.events.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.