# HG changeset patch # User Sylvain Thénault # Date 1320685753 -3600 # Node ID 6d8eb873256df4383eb1f1188aec89d372ef91ac # Parent 88ca47ceb9f201e6880062241419b36881c38537# Parent 1b2a05c9b71c4148eb0bf898f812e8c1c6574313 backport stable diff -r 88ca47ceb9f2 -r 6d8eb873256d doc/book/en/devrepo/repo/hooks.rst --- a/doc/book/en/devrepo/repo/hooks.rst Mon Nov 07 10:56:39 2011 +0100 +++ b/doc/book/en/devrepo/repo/hooks.rst Mon Nov 07 18:09:13 2011 +0100 @@ -110,7 +110,7 @@ parents.add(parent.eid) - class CheckSubsidiaryCycleOp(DataOperationMixIn, Operation): + class CheckSubsidiaryCycleOp(Operation): def precommit_event(self): check_cycle(self.session, self.eidto, 'subsidiary_of') @@ -145,7 +145,7 @@ def __call__(self): CheckSubsidiaryCycleOp.get_instance(self._cw).add_data(self.eidto) - class CheckSubsidiaryCycleOp(Operation): + class CheckSubsidiaryCycleOp(DataOperationMixIn, Operation): def precommit_event(self): for eid in self.get_data(): diff -r 88ca47ceb9f2 -r 6d8eb873256d web/request.py --- a/web/request.py Mon Nov 07 10:56:39 2011 +0100 +++ b/web/request.py Mon Nov 07 18:09:13 2011 +0100 @@ -793,8 +793,13 @@ The global doctype and xmldec must also be changed otherwise the browser will display '<[' at the beginning of the page """ - self.set_content_type('text/html') - self.main_stream.set_doctype(TRANSITIONAL_DOCTYPE_NOEXT) + if not self.vreg.config['force-html-content-type']: + if not hasattr(self, 'main_stream'): + raise Exception("Can't demote to html from an ajax context. You " + "should change force-html-content-type to yes " + "in the instance configuration file.") + self.set_content_type('text/html') + self.main_stream.set_doctype(TRANSITIONAL_DOCTYPE_NOEXT) def set_doctype(self, doctype, reset_xmldecl=True): """helper method to dynamically change page doctype