diff --git a/js/legacy/globals.js b/js/legacy/globals.js index ad8e552cdd..d949e6f628 100644 --- a/js/legacy/globals.js +++ b/js/legacy/globals.js @@ -78,3 +78,11 @@ var validated = true; var validation_message = ''; var tinymce_loaded = null; var cur_autosug = null; + +if(!console) { + var console = { + log: function(txt) { + errprint(txt); + } + } +} diff --git a/js/legacy/webpage/body.js b/js/legacy/webpage/body.js index 1e1d875258..7179579d21 100644 --- a/js/legacy/webpage/body.js +++ b/js/legacy/webpage/body.js @@ -82,12 +82,6 @@ function Body() { this.wrapper = $a($i('body_div'),'div'); this.body = $a(this.wrapper, 'div'); - - // sidebars - if(user_defaults.hide_sidebars) { - this.cp.left_sidebar_width = null; - this.cp.right_sidebar_width = null; - } this.setup_page_areas(); diff --git a/py/webnotes/boot.py b/py/webnotes/boot.py index c8e8450143..223ff6856f 100644 --- a/py/webnotes/boot.py +++ b/py/webnotes/boot.py @@ -22,7 +22,7 @@ def get_bootinfo(): del cp[field] # system info - bootinfo['control_panel'] = cp + bootinfo['control_panel'] = cp.copy() bootinfo['account_name'] = cp.get('account_id') bootinfo['sysdefaults'] = webnotes.utils.get_defaults() diff --git a/py/webnotes/session_cache.py b/py/webnotes/session_cache.py index ff7df92647..48bf174a92 100644 --- a/py/webnotes/session_cache.py +++ b/py/webnotes/session_cache.py @@ -60,15 +60,18 @@ def load(country): else: raise e -def add_to_cache(sd, country): +def add_to_cache(bootinfo, country): """add to cache""" import webnotes.model.utils - if sd.get('docs'): - sd['docs'] = webnotes.model.utils.compress(sd['docs']) + if bootinfo.get('docs'): + bootinfo['docs'] = webnotes.model.utils.compress(bootinfo['docs']) # delete earlier (?) - webnotes.conn.sql("delete from __SessionCache where user=%s and country=%s", (webnotes.session['user'], country)) + webnotes.conn.sql("""delete from __SessionCache where user=%s + and country=%s""", (webnotes.session['user'], country)) # make new - webnotes.conn.sql("insert into `__SessionCache` (user, country, cache) VALUES (%s, %s, %s)", (webnotes.session['user'], country, str(sd))) + webnotes.conn.sql("""insert into `__SessionCache` + (user, country, cache) VALUES (%s, %s, %s)""", \ + (webnotes.session['user'], country, str(bootinfo)))