diff --git a/openwisp_controller/config/static/config/js/utils.js b/openwisp_controller/config/static/config/js/utils.js index d5bb277a9..2eeacc8fb 100644 --- a/openwisp_controller/config/static/config/js/utils.js +++ b/openwisp_controller/config/static/config/js/utils.js @@ -56,10 +56,11 @@ evaluateVars = function (data, context) { getAllContext = function () { var userContextField = getContext(), - systemContext = JSON.parse(document.getElementById('system_context').textContent), + systemContextField = document.getElementById('system_context'), value; if (userContextField) { - var defaultValues = JSON.parse(userContextField.value); + var defaultValues = JSON.parse(userContextField.value), + systemContext = JSON.parse(systemContextField.textContent); value = Object.assign( {}, systemContext,