[edit controller] fix subform formid in EditController (would need further improvement) stable
authorFlorent Cayré <florent.cayre@gmail.com>
Thu, 31 Mar 2011 14:23:11 +0200
branchstable
changeset 7182 09454384fff8
parent 7181 e54ad6984e01
child 7183 5ea2bfd55399
[edit controller] fix subform formid in EditController (would need further improvement)
web/views/editcontroller.py
--- a/web/views/editcontroller.py	Wed Apr 06 09:57:28 2011 +0200
+++ b/web/views/editcontroller.py	Thu Mar 31 14:23:11 2011 +0200
@@ -182,7 +182,12 @@
         # process inlined relations at the same time as attributes
         # this will generate less rql queries and might be useful in
         # a few dark corners
-        formid = self._cw.form.get('__form_id', 'edition')
+        if is_main_entity:
+            formid = self._cw.form.get('__form_id', 'edition')
+        else:
+            # XXX inlined forms formid should be saved in a different formparams entry
+            # inbetween, use cubicweb standard formid for inlined forms
+            formid = 'edition'
         form = self._cw.vreg['forms'].select(formid, self._cw, entity=entity)
         eid = form.actual_eid(entity.eid)
         form.formvalues = {} # init fields value cache