[etype restriction component] rql 0.31 doesn't accept anymore a variable ref as add_type_restriction argument. Closes #2086983
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Thu, 10 Nov 2011 10:13:40 +0100
changeset 8080 623432dc1deb
parent 8079 0f1126b9038e
child 8082 1c37783ff610
[etype restriction component] rql 0.31 doesn't accept anymore a variable ref as add_type_restriction argument. Closes #2086983
web/views/basecomponents.py
--- a/web/views/basecomponents.py	Thu Nov 10 10:12:37 2011 +0100
+++ b/web/views/basecomponents.py	Thu Nov 10 10:13:40 2011 +0100
@@ -207,8 +207,8 @@
     to be able to filter accordingly.
     """
     __regid__ = 'etypenavigation'
-    __select__ = multi_etypes_rset() | match_form_params('__restrtype', '__restrtypes',
-                                                       '__restrrql')
+    __select__ = multi_etypes_rset() | match_form_params(
+        '__restrtype', '__restrtypes', '__restrrql')
     cw_property_defs = VISIBLE_PROP_DEF
     # don't want user to hide this component using an cwproperty
     site_wide = True
@@ -237,7 +237,7 @@
             else:
                 rqlst.save_state()
                 for select in rqlst.children:
-                    select.add_type_restriction(select.selection[0], etype)
+                    select.add_type_restriction(select.selection[0].variable, etype)
                 newrql = rqlst.as_string(self._cw.encoding, self.cw_rset.args)
                 url = self._cw.build_url(rql=newrql, __restrrql=restrrql,
                                          __restrtype=etype, __restrtypes=','.join(restrtypes))