From 220fdf583e6848f2e6b52a2df121967cf37d2831 Mon Sep 17 00:00:00 2001 From: Akshay Joshi Date: Fri, 2 Nov 2018 16:44:09 +0000 Subject: [PATCH] Allow use of 0 (integer) and empty strings as parameters in the debugger. Fixes #3629 --- docs/en_US/release_notes_3_6.rst | 3 ++- web/pgadmin/tools/debugger/__init__.py | 23 ++++++++++--------- .../tools/debugger/static/js/debugger_ui.js | 3 +-- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/docs/en_US/release_notes_3_6.rst b/docs/en_US/release_notes_3_6.rst index 3215b65ab..53557033e 100644 --- a/docs/en_US/release_notes_3_6.rst +++ b/docs/en_US/release_notes_3_6.rst @@ -15,4 +15,5 @@ Features Bug fixes ********* -| `Bug #3029 `_ - Allow the selection order to be preserved in the Select2 control to fix column ordering in data Import/Export. \ No newline at end of file +| `Bug #3029 `_ - Allow the selection order to be preserved in the Select2 control to fix column ordering in data Import/Export. +| `Bug #3629 `_ - Allow use of 0 (integer) and empty strings as parameters in the debugger. \ No newline at end of file diff --git a/web/pgadmin/tools/debugger/__init__.py b/web/pgadmin/tools/debugger/__init__.py index 250efa47a..dca39b131 100644 --- a/web/pgadmin/tools/debugger/__init__.py +++ b/web/pgadmin/tools/debugger/__init__.py @@ -1806,17 +1806,18 @@ def set_arguments_sqlite(sid, did, scid, func_id): # handle the Array list sent from the client array_string = '' - if data[i]['value'].__class__.__name__ in ( - 'list') and data[i]['value']: - for k in range(0, len(data[i]['value'])): - array_string += data[i]['value'][k]['value'] - if k != (len(data[i]['value']) - 1): - array_string += ',' - elif data[i]['value'].__class__.__name__ in ( - 'list') and not data[i]['value']: - array_string = '' - else: - array_string = data[i]['value'] + if 'value' in data[i]: + if data[i]['value'].__class__.__name__ in ( + 'list') and data[i]['value']: + for k in range(0, len(data[i]['value'])): + array_string += data[i]['value'][k]['value'] + if k != (len(data[i]['value']) - 1): + array_string += ',' + elif data[i]['value'].__class__.__name__ in ( + 'list') and not data[i]['value']: + array_string = '' + else: + array_string = data[i]['value'] # Check if data is already available in database then update the # existing value otherwise add the new value diff --git a/web/pgadmin/tools/debugger/static/js/debugger_ui.js b/web/pgadmin/tools/debugger/static/js/debugger_ui.js index 1fb5aab54..303c9ce0c 100644 --- a/web/pgadmin/tools/debugger/static/js/debugger_ui.js +++ b/web/pgadmin/tools/debugger/static/js/debugger_ui.js @@ -901,8 +901,7 @@ define([ } // TODO: Need to check the "Expression" column value to // enable/disable the "Debug" button - if (this.collection.models[i].get('value') == '' || - this.collection.models[i].get('value') == null || + if (this.collection.models[i].get('value') == null || this.collection.models[i].get('value') == undefined) { enable_btn = true;