[web/request] Prune extraneous 'pageid' from generated ajax URL parameters (closes #2758130) stable
authorRémi Cardona <remi.cardona@logilab.fr>
Wed, 13 Mar 2013 18:36:49 +0100
branchstable
changeset 8730 d4d9f33fd01b
parent 8729 ea3fc8e1edee
child 8731 93c0c31875ac
[web/request] Prune extraneous 'pageid' from generated ajax URL parameters (closes #2758130) If 'pageid' is given through extraparams, it is sent twice to the browser. On the JS side, the final URL loadxhtml() will end up using will have 'pageid' set twice which CubicWeb will readily accept as a list. Pruning this parameter makes sure it is exactly once.
web/request.py
--- a/web/request.py	Wed Mar 13 19:23:22 2013 +0100
+++ b/web/request.py	Wed Mar 13 18:36:49 2013 +0100
@@ -714,6 +714,9 @@
         # after having url unescaping the content. This may make appear some
         # quote or other special characters that will break the js expression.
         extraparams.setdefault('fname', 'view')
+        # remove pageid from the generated URL as it's forced as a parameter
+        # to the loadxhtml call below.
+        extraparams.pop('pageid', None)
         url = self.build_url('ajax', **extraparams)
         cbname = build_cb_uid(url[:50])
         # think to propagate pageid. XXX see https://www.cubicweb.org/ticket/1753121