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

Module settings not saving #231

Open
brownjerod opened this issue Feb 12, 2021 · 42 comments · Fixed by #241
Open

Module settings not saving #231

brownjerod opened this issue Feb 12, 2021 · 42 comments · Fixed by #241
Labels
stale Issue without activity for a long time

Comments

@brownjerod
Copy link

We have had this issue on a few sites that we are using the module, but haven't seen any others mention it

Steps to reproduce the behavior:

  1. Go to Event Module Settings
  2. On 2 different sites, we have under the General Tab, "Filter Events by Category", I would select one of the categories, click save, and none of the changes take affect. Have experienced the same issue under the Display tab, "Events List Settings", "Select Events by Number" changed from 2 to 5 for example, and click save, and no changes take affect.
@james7342
Copy link

james7342 commented Feb 18, 2021

Take a look at closed issue #229. The last note by Ernst indicates he had some suspicion to I believe what you're experiencing might be an issue this.

" 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."

@james7342
Copy link

@EPTamminga I think your suspicions were correct.

@EPTamminga
Copy link
Member

I know, I also know why, but I have not solved it yet. I have to define a new method to save the list of id's in settings.

@brownjerod
Copy link
Author

does anyone know if there is a way to bypass the settings and make a change in the database for now that would allow for the filter by categories? We have this live on a client site, and long story short was forced to update to 9.8 which we never do for this reason and we are in a jam to find a temp fix if it is possible.

@brownjerod
Copy link
Author

Does anyone know if there is a way to bypass the settings and make a change in the database for now that would allow for the filter by categories? We have this live on a client site, and long story short was forced to update to 9.8 which we never do for this reason and we are in a jam to find a temp fix if it is possible.

@james7342
Copy link

I don't think so. Looking at the DB and the value stored it looks like it's just storying a string value of "System.Collections.ArrayList". My thought is it should be a value or array of selected values. Maybe Ernst has some ideas.

@EPTamminga
Copy link
Member

AFAIK, There is no hotfix.
The problem was introduced (I think) when the settings routines in the core were modified in 980.

@djamell
Copy link

djamell commented Feb 28, 2021

I use the "Filter Events by Category" setting on several government websites so this is important to me also before I upgrade.

@brownjerod
Copy link
Author

I wanted to check back in and see if anyone had made any headway on this? We have some sites actively using this with original functionality they cannot use and I am having to look at alternatives which I really do not want to move to if I can avoid it.

@EPTamminga
Copy link
Member

@brownjerod I am working on a solution. Should be ready for test in a week or so

@EPTamminga
Copy link
Member

@djamell @brownjerod @james7342 @techbubble

I think I have created a fix for the setting Category/Location filters not being saved. If you are able to test it before I create a new release, I would be more than happy.

The test can be done by replacing the Events DLL in the bin\ folder with the ones in the attached zip. An instruction .txt file is also in the .zip file. DNN_Events_07.00.08_TEST_DLL.s_UNZIPME.zip

As always, testing should be done in a test environment and not in production.

@djamell
Copy link

djamell commented Mar 29, 2021

Yes, I will try this. It might take a day or so to get back to you.

Thanks @EPTamminga !

@james7342
Copy link

james7342 commented Mar 30, 2021

@EPTamminga, I tested this build on my test site and it appears to work as expected. I did a few application restarts and also confirmed via DB that comma separated values where written versus the prior "System.Collections.ArrayList". My testing though only validated categories as I don't have any locations defined. If the same code logic is applied there I think that locations would also test with success.

@djamell
Copy link

djamell commented Mar 30, 2021

I'm just finishing up testing and while the settings do save correctly for categories and location, I ran into another problem.

If I filter by categories when I click to add a new event I get the following error:

ModuleId:539
ModuleDefId:131
FriendlyName:
ModuleControlSource:DesktopModules/Events/EditEvents.ascx
AbsoluteURL:/Default.aspx
DefaultDataProvider:DotNetNuke.Data.SqlDataProvider, DotNetNuke
ExceptionGUID:47be05d0-a969-4e51-b309-fa002df67acc
AssemblyVersion:9.9.0
PortalId:0
UserId:2
TabId:122
RawUrl:/Departments/Circuit-Clerk/Commissioners-Sales/ctl/Edit/mid/539
Referrer:http://dev.jamelldigital.com/Departments/Circuit-Clerk/Commissioners-Sales
UserAgent:Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:87.0) Gecko/20100101 Firefox/87.0
ExceptionHash:YeV9/mMOikPVtz/IlQ76PtgSZoQ=
Message:Specified cast is not valid.
StackTrace:
InnerMessage:Specified cast is not valid.
InnerStackTrace:
at DotNetNuke.Modules.Events.EditEvents.LoadCategory(Int32 category) in C:\DDrive\Develop\GitHub\DNN.Events\EditEvents.ascx.cs:line 1193
at DotNetNuke.Modules.Events.EditEvents.LoadEvent() in C:\DDrive\Develop\GitHub\DNN.Events\EditEvents.ascx.cs:line 983
at DotNetNuke.Modules.Events.EditEvents.Page_Load(Object sender, EventArgs e) in C:\DDrive\Develop\GitHub\DNN.Events\EditEvents.ascx.cs:line 226

Source:
FileName:
FileLineNumber:0
FileColumnNumber:0
Method:
Server Name: XXXXXXX

@djamell
Copy link

djamell commented Mar 30, 2021

Follow up to my previous:

I had "Enable Category Select" set to "Do Not Display".

If I set "Enable Category Select" to either of the other two options I do not get the error and the Edit Details functions appear to work.

@james7342
Copy link

@djamell, good info. I was trying to duplicate the issue and was unable to. With this additional info I can duplicate it also now.

ModuleId:453
ModuleDefId:122
FriendlyName:
ModuleControlSource:DesktopModules/Events/EditEvents.ascx
AbsoluteURL:/Default.aspx
DefaultDataProvider:DotNetNuke.Data.SqlDataProvider, DotNetNuke
ExceptionGUID:37fbe015-8d2c-4ea1-8e59-439956670b51
AssemblyVersion:9.9.0
PortalId:0
UserId:1
TabId:88
RawUrl:/Calendar/Chapter-Events/ctl/Edit/mid/453?popUp=true
Referrer:https://www.xxxxxxx.com/Calendar/Chapter-Events
UserAgent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0.3 Safari/605.1.15
ExceptionHash:YeV9/mMOikPVtz/IlQ76PtgSZoQ=
Message:Specified cast is not valid.
StackTrace:
InnerMessage:Specified cast is not valid.
InnerStackTrace:
at DotNetNuke.Modules.Events.EditEvents.LoadCategory(Int32 category) in C:\DDrive\Develop\GitHub\DNN.Events\EditEvents.ascx.cs:line 1193
at DotNetNuke.Modules.Events.EditEvents.LoadEvent() in C:\DDrive\Develop\GitHub\DNN.Events\EditEvents.ascx.cs:line 983
at DotNetNuke.Modules.Events.EditEvents.Page_Load(Object sender, EventArgs e) in C:\DDrive\Develop\GitHub\DNN.Events\EditEvents.ascx.cs:line 226
Source:
FileName:
FileLineNumber:0
FileColumnNumber:0
Method:
Server Name: generic262

@EPTamminga
Copy link
Member

@james7342 @djamell
Tnx for the test, scenario and debug info. It will fixing easier.
More later!

@EPTamminga
Copy link
Member

I am working on it, I thought I solved it, but a related problem now appears on another point.

@djamell
Copy link

djamell commented Apr 4, 2021

Please let me know if I can do any testing. And thanks for the update

@EPTamminga
Copy link
Member

@djamell @brownjerod @james7342 @techbubble

New test round, new fixes.

A new problem arose when I started to edit an event that was originally created with a category that was no longer allowed in the settings of the module. In short: be sure the set the right category and location limitations in the module settings before you start entering new events.

If you are able to test it before I create a new release, I would be more than happy.

The test can be done by replacing the Events DLL in the bin\ folder with the ones in the attached zip. An instruction .txt file is also in the .zip file. DNN_Events_07.00.08_B_TEST_DLL.s_UNZIPME.zip

As always, testing should be done in a test environment and not in production.

@djamell
Copy link

djamell commented Apr 5, 2021

With the latest DLLs, Restrict Categories now allows me to add an event but it does not display on the Calendar.

If I uncheck Restrict Categories the event displays.

@EPTamminga
Copy link
Member

@djamell If, after editing, you page back/forward a month, the event does display or not?

@djamell
Copy link

djamell commented Apr 8, 2021

Yes!

Also, I discovered by accident that if you set "Filter Events by Category" to "All" and check Restrict Categories the module throws an error when either adding or editing. Even though those settings should not work in that combination I wouldn't think you would want it to error.

@EPTamminga
Copy link
Member

@djamell Tnx. Most errors are a result of a casting/type difference between VB.net and C# and are a result of the migration of the source from VB.net to C# some versions ago.
It will be solved in the end. Tnx for testing.

@HZass
Copy link

HZass commented Apr 20, 2021

Using Events Release 7.0.7 with DNN 9.6.2. I cannot find where either Locations or Categories are saved on the database. Thus, if you attempt to restrict events to a specific category or location, you cannot add a new event. The entry of both category and location on the Module Settings table is just Array List, with no values for the array list.

@EPTamminga
Copy link
Member

@HZass This is an error in DNN7.x. I solved in V7.0.8, but there are some small issues left.

@HZass
Copy link

HZass commented May 11, 2021

Any update on when this issue will be incorporated into a release? Is there a release date?

@EPTamminga
Copy link
Member

@HZass No release date set (free time is sparse).

I have to fix at least 1 issue (refresh calendar after adding a new event). That might take 5 minutes, or multiple hours or more.

@travisdiehlgdc
Copy link

Is there any update for this issue? I support a website in which the module is displaying events from the wrong category due to this issue.

@djamell
Copy link

djamell commented Jun 25, 2021

I too am interested in the fully fixed version.

@james7342
Copy link

Any more progress on this issue?

@WillStrohl
Copy link
Member

I'm sure that it would be easier to ensure the progress of an open-source issue being worked on by sponsoring an interested developer. We're all always so busy with client work, and usually can only fix things here that are either sponsored, or inspired to resolve during our free time on evenings and weekends.

It's also always faster to fix something yourself via a Pull Request.

If you don't have the skill set, then the sponsorship route is obviously a better choice for anyone with a time constraint. :)

KevinSigl added a commit to KevinSigl/DNN.Events that referenced this issue Sep 7, 2021
@KevinSigl KevinSigl mentioned this issue Sep 7, 2021
3 tasks
@HZass
Copy link

HZass commented Oct 28, 2021

The following code should replace LoadLocation() in the EditSettings.ascx.cs file to completely close Issue 231:

    public void LoadLocation(int location = default(int))
    {
        /*
        var objCntLocation = new EventLocationController();
        cmbLocation.DataSource = objCntLocation.EventsLocationList(PortalId);
        cmbLocation.DataTextField = "LocationName";
        cmbLocation.DataValueField = "Location";
        cmbLocation.DataBind();
        //"<None Specified>"
        cmbLocation.Items.Insert(
            0, new ListItem(Localization.GetString("None", LocalResourceFile), "-1"));
        if (location > 0)
        {
            cmbLocation.Items.FindByValue(Convert.ToString(location)).Selected = true;
        }
        */

        var objCntLocations = new EventLocationController();
        var tmpLocations = objCntLocations.EventsLocationList(PortalId);
        var objLocations = new ArrayList();
        if ((Settings.Enablelocations == EventModuleSettings.DisplayLocations.DoNotDisplay) &
            (Settings.ModuleLocationsSelected == EventModuleSettings.LocationsSelected.Some)
            || Settings.Restrictlocations)
        {
            foreach (EventLocationInfo objLocation in tmpLocations)
            {
                foreach (object moduleLocation in Settings.ModuleLocationIDs)
                {
                    if (Convert.ToInt32(moduleLocation) == objLocation.Location)
                    {
                        objLocations.Add(objLocation);
                    }
                }
            }
        }
        else
        {
            objLocations = tmpLocations;
        }
        cmbLocation.DataSource = objLocations;
        cmbLocation.DataTextField = "LocationName";
        cmbLocation.DataValueField = "Location";
        cmbLocation.DataBind();

        // Do we need to add None
        if (!(Settings.Enablelocations == EventModuleSettings.DisplayLocations.DoNotDisplay) |
            (Settings.ModuleLocationsSelected == EventModuleSettings.LocationsSelected.All)
            && Settings.Restrictlocations == false)
        {
            cmbLocation.Items.Insert(
                0, new ListItem(Localization.GetString("None", LocalResourceFile), "-1"));
        }

        // Select the appropriate row
        if (Settings.ModuleLocationsSelected == EventModuleSettings.LocationsSelected.All)
        {
            cmbLocation.ClearSelection();
            cmbLocation.Items[0].Selected = true;
        }

        if (location > 0)
        {
            cmbLocation.ClearSelection();
            cmbLocation.Items.FindByValue(Convert.ToString(location)).Selected = true;
        }
        else if (!(Settings.Enablelocations == EventModuleSettings.DisplayLocations.DoNotDisplay) &
                 (Settings.ModuleLocationsSelected == EventModuleSettings.LocationsSelected.Some))
        {
            cmbLocation.ClearSelection();
            cmbLocation.Items.FindByValue(Convert.ToString(Settings.ModuleLocationIDs[0])).Selected =
                true;
        }

    }

@djamell
Copy link

djamell commented Nov 17, 2021

I just ran headlong into the problem of not saving "Filter Events by Category" selections. Is there any chance this could be fixed soon?

@djamell
Copy link

djamell commented May 18, 2022

Bump, Please

@valadas
Copy link
Member

valadas commented May 18, 2022

A bump comment won't do anything here.
This is open source if nobody contributes code or sponsors someone to do so, issues are just a list for when/if a developer gets enough free time to handle them... Also, submitting code in an issue does not make it very actionable @HZass can you do a pull request please.

@djamell
Copy link

djamell commented May 18, 2022

Hi Daniel,
I provided troubleshooting information and did testing and reporting on those tests in this thread above for this Issue. So I have been participating in this solution even through I am not a developer.

I have worked with Ernst Peter on issues related to the Events Module project for many years.

I just noticed that Hans had submitted code back in October and I was excited to see if there could be a new version soon.

@EPTamminga
Copy link
Member

I will review and aim to create a new version.

@EPTamminga
Copy link
Member

Not finished yet

@EPTamminga
Copy link
Member

I am working on at least one issue before release: a refresh after the settings update when the filtered category or location has changed in the settings.
This is not reflected on coming back to the month, but after a click month forward and backwards, it shows the correct pre-selected events.

@djamell
Copy link

djamell commented Jun 1, 2022

Understood. Thanks for all you are doing.

@stale
Copy link

stale bot commented Jun 18, 2023

We have detected this issue has not had any activity during the last 180 days.
That could mean this issue is no longer relevant and/or nobody has found the necessary time to address the issue.
We are trying to keep the list of open issues limited to those issues that are relevant to the majority and to close the ones that have become 'stale' (inactive). If no further activity is detected within the next 21 days, the issue will be closed automatically.
If new comments are are posted and/or a solution (pull request) is submitted for review that references this issue, the issue will not be closed. Closed issues can be reopened at any time in the future.
Please remember those participating in this open source project are volunteers trying to help others and creating a better DNN Platform for all.
Thank you for your continued involvement and contributions!

@stale stale bot added the stale Issue without activity for a long time label Jun 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale Issue without activity for a long time
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants