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

BUG: NullReferenceException when saving module settings on upgraded sites #774

Closed
johnhenley opened this issue Apr 24, 2024 · 2 comments · Fixed by #776
Closed

BUG: NullReferenceException when saving module settings on upgraded sites #774

johnhenley opened this issue Apr 24, 2024 · 2 comments · Fixed by #776
Assignees
Labels
bug Something isn't working
Milestone

Comments

@johnhenley
Copy link
Collaborator

Describe the bug

If you have an existing site that is upgraded to 8.0.x, you will get an exception when saving module settings. The exception doesn't really affect behavior unless you are using the module for a social group rather than standard forums.

Software Versions

  • DNN: 09.12.00
  • Module: 08.00.01

Version 8.0 added a new feature for banning users (PR #257), which required an additional security property "ModUser" to allow moderators to change users' settings (and ban them). This was added to security settings in the control panel (for standard forums) and module settings (for a social group forum) and to the configuration file used for new sites. The security settings are still stored as a module setting ("ForumConfig") -- even when the module is not used for a social group. However, for existing sites there were upgraded, the module setting was not updated. The result is that, when you switch the module settings from "standard" to "social group" on an upgraded site, you see a missing column on the right:
image

On a new install, it looks like this:
image

In addition, when the module settings are saved for an upgraded site, there is an exception in the admin log:
image

When run in the debugger, shows that this is caused by an incomplete list of security properties:
image

@johnhenley johnhenley added the bug Something isn't working label Apr 24, 2024
@johnhenley johnhenley added this to the 08.01.00 milestone Apr 24, 2024
@johnhenley johnhenley self-assigned this Apr 24, 2024
@Timo-Breumelhof
Copy link
Contributor

@johnhenley good catch :-)

@johnhenley
Copy link
Collaborator Author

@WillStrohl wanted to get an opinion on this one. I've figured this out and have a code change ready. But as always, this uncovers a different but related issue. There are four settings (this being one) that are stored (intentionally, if you look at the code) into TabModuleSettings but because they are properties in the module settings, they end up getting stored in both TabModuleSettings and ModuleSettings. My intuition is to leave them in ModuleSettings and change to no longer store in TabModuleSettings. Since the module is not sharable on other pages/tabs, storing settings in TabModuleSettings really doesn't make any sense. What do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants