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

Fixed "Allow Indexing" module setting #3657

Merged
merged 1 commit into from
Apr 7, 2020

Conversation

daguiler
Copy link
Contributor

@daguiler daguiler commented Apr 2, 2020

Fixes #3656

Summary

After installation, some modules have no entries in TabModuleSettings or ModuleSettings. This is the case for instance of the "CONNECT and PARTICIPATE" module in the home page. In such cases, a default value is calculated in DNN Platform\Website\admin\Modules\Modulesettings.ascx.cs.

The default value of "Allow Indexing" setting is True, as calculated at line 116 (BindData method):

chkAllowIndex.Checked = Settings["AllowIndex"] == null || Settings["AllowIndex"] != null && bool.Parse(Settings["AllowIndex"].ToString());

but at line 558 (OnUpdateClick method) the expression is different and generates a False default value:

var allowIndex = Settings.ContainsKey("AllowIndex") && Convert.ToBoolean(Settings["AllowIndex"]);

This bug then affects the decision on whether to update the setting or not:

//check whether allow index value is changed
if (allowIndex != chkAllowIndex.Checked)
{
    ModuleController.Instance.UpdateTabModuleSetting(Module.TabModuleID, "AllowIndex", chkAllowIndex.Checked.ToString());
}

resulting in inability to turn it off.

Copy link
Contributor

@donker donker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

My only thought is: yet another method to "unnull" a value? Can't we centralize this one day?

@daguiler
Copy link
Contributor Author

daguiler commented Apr 7, 2020

Yes, I agree and I believe this is a step in that direction.

@bdukes bdukes merged commit 1b1cd88 into dnnsoftware:develop Apr 7, 2020
@daguiler daguiler deleted the bugfix/DNN-37895 branch April 7, 2020 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow Indexing module setting can't be unchecked
3 participants