[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.
--- 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