# HG changeset patch # User Sylvain Thénault # Date 1479307975 -3600 # Node ID c71339453c1e6a27ea53d043dfea618197324d5b # Parent dfcc3f74b3c8a16e295e7e2944900ea3f9d7da57 [uicfg] Remove unpredictability from autoform_section initialization It was attempting to guess smart default values by looking at the opposite relation (neg_role), but depending on the (random) ordering of the schema, it may or may not have been set yet, leading to unpredictable result with varying hash seed. Remove those fuzzy lookup all at once, it may change some (unreliable) things in your app but at least it's still a bit easier to explain. Closes #16272968 diff -r dfcc3f74b3c8 -r c71339453c1e cubicweb/web/views/uicfg.py --- a/cubicweb/web/views/uicfg.py Mon Nov 21 14:55:27 2016 +0100 +++ b/cubicweb/web/views/uicfg.py Wed Nov 16 15:52:55 2016 +0100 @@ -220,12 +220,7 @@ formsections = self.init_get(sschema, rschema, oschema, role) if formsections is None: formsections = self.tag_container_cls() - if not any(tag.startswith('inlined') for tag in formsections): - if not rschema.final: - negsects = self.init_get(sschema, rschema, oschema, neg_role(role)) - if 'main_inlined' in negsects: - formsections.add('inlined_hidden') - key = _ensure_str_key( (sschema, rschema, oschema, role) ) + key = _ensure_str_key((sschema, rschema, oschema, role)) self._tagdefs[key] = formsections def _initfunc_step2(self, sschema, rschema, oschema, role): @@ -243,12 +238,7 @@ sectdict.setdefault('inlined', 'hidden') # ensure we have a tag for each form type if not 'main' in sectdict: - if not rschema.final and ( - sectdict.get('inlined') == 'attributes' or - 'inlined_attributes' in self.init_get(sschema, rschema, oschema, - neg_role(role))): - sectdict['main'] = 'hidden' - elif sschema.is_metadata(rschema): + if sschema.is_metadata(rschema): sectdict['main'] = 'metadata' else: card, composed = _card_and_comp(sschema, rschema, oschema, role)