From 64d29f418a2f9cf25e1f72ad2715d1832a70415f Mon Sep 17 00:00:00 2001 From: Noumbissi Valere Date: Sun, 6 Dec 2020 01:42:07 +0100 Subject: [PATCH] [fix] Fixed system context js error #334 Fixes #334 --- openwisp_controller/config/static/config/js/utils.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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,