closes #1901436: view/modify action in table don't work stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Fri, 05 Aug 2011 10:29:19 +0200
branchstable
changeset 7744 bb956f43e8d4
parent 7743 e55e439a6888
child 7745 1013c31bfbee
closes #1901436: view/modify action in table don't work
web/views/actions.py
--- a/web/views/actions.py	Fri Aug 05 09:27:53 2011 +0200
+++ b/web/views/actions.py	Fri Aug 05 10:29:19 2011 +0200
@@ -135,8 +135,13 @@
         params = self._cw.form.copy()
         for param in ('vid', '__message') + controller.NAV_FORM_PARAMETERS:
             params.pop(param, None)
-        return self._cw.build_url(self._cw.relative_path(includeparams=False),
-                                  **params)
+        if self._cw.json_request:
+            path = 'view'
+            if self.cw_rset is not None:
+                params = {'rql': self.cw_rset.printable_rql()}
+        else:
+            path = self._cw.relative_path(includeparams=False)
+        return self._cw.build_url(path, **params)
 
 
 class ModifyAction(action.Action):
@@ -163,7 +168,7 @@
     order = 10
 
     def url(self):
-        return self._cw.build_url('view', rql=self.cw_rset.rql, vid='muledit')
+        return self._cw.build_url('view', rql=self.cw_rset.printable_rql(), vid='muledit')
 
 
 # generic "more" actions #######################################################