# HG changeset patch
# User Aurelien Campeas <aurelien.campeas@logilab.fr>
# Date 1339574771 -7200
# Node ID 202625f247b4bb1a03c41b03bdfb545469bfd34f
# Parent  e019128549f5916f9f4473a75a94cf4aba5c3dfd
[views/tabs] fix rql/eid param conflict when either one is already in the request form (closes #2405249)

diff -r e019128549f5 -r 202625f247b4 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