From af3c93051f3f8c8a55df1328195d5ebdb37fce28 Mon Sep 17 00:00:00 2001 From: Denis Flaven Date: Tue, 23 Dec 2014 14:49:06 +0000 Subject: [PATCH] Protect against JS errors when the form is in read-only mode. SVN:trunk[3482] --- js/property_field.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/js/property_field.js b/js/property_field.js index bf859b129..6f55ee3bc 100644 --- a/js/property_field.js +++ b/js/property_field.js @@ -344,8 +344,15 @@ $(function() var oWidget = me._get_widget($(this).closest('.itop-property-field')); if (oWidget) { - oWidget._setOptions({can_apply: !me.bModified, parent_selector: '#'+me.element.attr('id') }); - oWidget.validate(); + try + { + oWidget._setOptions({can_apply: !me.bModified, parent_selector: '#'+me.element.attr('id') }); + oWidget.validate(); + } + catch(e) + { + // Do nothing, form in read-only mode + } } } });