You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The code only updates the configuration variables if the key is not defined in the System Defined Variables and is not already defined in the Configuration Variables for the device.
In this case, when you change the template, the configuration variables already have {'ssid': 'placeholder'} because it was set by the previous template. Therefore, the code does not update the configuration variable, assuming the user intentionally set it and wants to preserve their custom value.
This behavior was likely implemented to prevent overriding of configuration variables that were intentionally set by the user.
Consider the following scenario, where there are two templates as follows:
{'ssid': 'OpenWISP'}
{'ssid': 'placeholder'}
How to replicate
{'ssid': 'placeholder'}
. This is correct.Expected Result:
You would expect the configuration variables to reflect
{'ssid': 'OpenWISP'}
because the new template has a different value forssid
.Actual Result:
The configuration variables still show
{'ssid': 'placeholder'}
.Explanation:
The issue occurs due to this JavaScript code:
openwisp-controller/openwisp_controller/config/static/config/js/widget.js
Lines 34 to 38 in 14f96ab
The code only updates the configuration variables if the key is not defined in the
System Defined Variables
and is not already defined in theConfiguration Variables
for the device.In this case, when you change the template, the configuration variables already have
{'ssid': 'placeholder'}
because it was set by the previous template. Therefore, the code does not update the configuration variable, assuming the user intentionally set it and wants to preserve their custom value.This behavior was likely implemented to prevent overriding of configuration variables that were intentionally set by the user.
Originally posted by @pandafy in #779 (comment)
The text was updated successfully, but these errors were encountered: