On 06/13/2013 02:46 PM, Ana Krivokapic wrote:
On 06/13/2013 12:30 PM, Petr Vobornik wrote:
Rule tables with external member has more than one column and
therefore exclude parameter for adder dialog is not array of strings
but array of objects. normalize_values function can't work with it and
causes JS error.

This patch creates proper exclude array before passing it to adder
dialog.

https://fedorahosted.org/freeipa/ticket/3711

ACK



I've noticed that there is a leftover from a different approach:

             pkey: pkey,
+            param: that.name,
             other_entity: that.other_entity,

The line is removed, updated patch attached.
--
Petr Vobornik
From 93e3b2a4cec826029beb2f58beb16049886cb04d Mon Sep 17 00:00:00 2001
From: Petr Vobornik <pvobo...@redhat.com>
Date: Wed, 12 Jun 2013 16:01:26 +0200
Subject: [PATCH] Regression fix: rule table with ext. member support doesn't
 offer any items

There is a JS error.

Rule tables with external member has more than one column and therefore exclude parameter for adder dialog is not array of strings but array of objects. normalize_values function can't work with it and causes JS error.

This patch creates proper exclude array before passing it to adder dialog.

https://fedorahosted.org/freeipa/ticket/3711
---
 install/ui/src/freeipa/rule.js | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/install/ui/src/freeipa/rule.js b/install/ui/src/freeipa/rule.js
index 959aec462d1c1e36220d3569fe2e776a60ab2c11..f573b56d469ac8c6652f8e49c66fd6fd1259db90 100644
--- a/install/ui/src/freeipa/rule.js
+++ b/install/ui/src/freeipa/rule.js
@@ -149,6 +149,14 @@ IPA.rule_association_table_widget = function(spec) {
         title = title.replace('${primary_key}', pkey);
         title = title.replace('${other_entity}', other_entity_label);
 
+        var exclude = that.values;
+        if (that.external) {
+            exclude = [];
+            for (var i=0; i<that.values.length; i++) {
+                exclude.push(that.values[i][that.name]);
+            }
+        }
+
         return IPA.rule_association_adder_dialog({
             title: title,
             pkey: pkey,
@@ -156,7 +164,7 @@ IPA.rule_association_table_widget = function(spec) {
             attribute_member: that.attribute_member,
             entity: that.entity,
             external: that.external,
-            exclude: that.values
+            exclude: exclude
         });
     };
 
-- 
1.8.1.4

_______________________________________________
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

Reply via email to