From 7a007d958b502df0aa94f03489db54680bdac655 Mon Sep 17 00:00:00 2001 From: Pavel Zuna Date: Tue, 17 Aug 2010 14:53:03 -0400 Subject: Fix Update function on details page. The problem was that parameters with no values are automatically set to None by the framework and it wasn't handled properly in baseldap.py:get_attributes function. Also, there were two logical bugs in details.js: 1) atttribute callback to update values were called for input elements instead of dt elements 2) it was always trying to update the primary key --- install/static/details.js | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'install') diff --git a/install/static/details.js b/install/static/details.js index f9da3f996..d47cfe8b5 100644 --- a/install/static/details.js +++ b/install/static/details.js @@ -92,16 +92,8 @@ function ipa_details_update(pkey, on_win, on_fail) return; var attr = dt.attr('title'); - if (!attr) - return; - - if (attr.indexOf('call_') == 0) { - var func = window[attr.substr(5)]; - if (!func) - return; - func(dt, modlist, IPA_DETAILS_UPDATE); + if (!attr || attr.indexOf('call_') == 0) return; - } var param_info = ipa_get_param_info(attr); if (param_info) { @@ -118,8 +110,19 @@ function ipa_details_update(pkey, on_win, on_fail) var jobj = $(this); var attr = jobj.attr('title'); - if (!attr || attr.indexOf('call_') == 0) + if (!attr) + return; + + if (attr.indexOf('call_') == 0) { + var func = window[attr.substr(5)]; + if (func) + func(jobj, modlist, IPA_DETAILS_UPDATE); return; + } + + var param_info = ipa_get_param_info(attr); + if (param_info && param_info['primary_key']) + return; var next = jobj.next('dd'); if ((!next.length) || (!next.children('input').length)) -- cgit