[views/tabs] fix rql/eid param conflict when either one is already in the request form (closes #2405249)
authorAurelien Campeas <aurelien.campeas@logilab.fr>
Wed, 13 Jun 2012 10:06:11 +0200
changeset 8442 202625f247b4
parent 8441 e019128549f5
child 8443 86fc11fb6f99
[views/tabs] fix rql/eid param conflict when either one is already in the request form (closes #2405249)
web/views/tabs.py
--- a/web/views/tabs.py	Mon Jun 11 14:53:23 2012 +0200
+++ b/web/views/tabs.py	Wed Jun 13 10:06:11 2012 +0200
@@ -47,7 +47,15 @@
         """a lazy version of wview"""
         w = w or self.w
         self._cw.add_js('cubicweb.ajax.js')
+        # the form is copied into urlparams to please the inner views
+        # that might want to take params from it
+        # beware of already present rql or eid elements
+        # to be safe of collision a proper argument passing protocol
+        # (with namespaces) should be used instead of the current
+        # ad-hockery
         urlparams = self._cw.form.copy()
+        urlparams.pop('rql', None)
+        urlparams.pop('eid', None)
         urlparams.update({'vid' : vid, 'fname' : 'view'})
         if rql:
             urlparams['rql'] = rql