-
Notifications
You must be signed in to change notification settings - Fork 753
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
Fix UpdateModuleSetting in ModuleController #3360
Fix UpdateModuleSetting in ModuleController #3360
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change seems fine, but I don't see how it would fix #2868. That issue is that updating an existing settings doesn't have an effect, but this code does the exact same existValue != settingValue
check in that scenario, right? I'm probably missing a piece to understanding this change. Do you have a sample module you've been testing with which demonstrates the fix works?
Hi Brian,
the TestProperty is correctly set in the ModuleSettings table. Actually I haven't tried the same code with the unpatched version yet but reading the issue it seems that the problem is consistent. Regarding the original code, the second condition in 'else if' was executed only when the 'settingValue' was null. |
I tried your test code and it appears to work correctly on 9.4.3 (without this patch). @mitchelsellers were you testing a different scenario in #2868? |
@engineering87 had you run into this issue in practice, or were you just tackling it based on @mitchelsellers' issue #2868? It would be great if we could isolate and reproduce the real issue to make sure any change we make is truly helpful. |
Actually just tackling it based on the #2868 issue but I will make further checks and tests to try to replicate what has been reported. |
From what I can tell. It appears that this is no longer an issue. It was recreatable when I submitted the issue, but I cannot now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually find this code proposal better than what was there. It's more logical: first check if the value was previously set and only then check for a changed value, not the other way around.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me
Fix the 'UpdateModuleSetting' method in ModuleController refactoring the update module conditions.
Issue #2868
Summary
Modified the update conditions, removed the 'settingExist' variable and check directly the settings value.