Univention Bugzilla – Bug 31782
LDAP_Search broken
Last modified: 2018-04-13 13:28:24 CEST
Traceback (most recent call last): File "/usr/lib/pymodules/python2.6/univention/management/console/modules/__init__.py", line 204, in execute func( request ) File "/usr/lib/pymodules/python2.6/univention/management/console/modules/udm/__init__.py", line 739, in properties properties = module.get_properties( object_dn ) File "/usr/lib/pymodules/python2.6/univention/management/console/modules/udm/udm_ldap.py", line 578, in get_proper properties = self.properties File "/usr/lib/pymodules/python2.6/univention/management/console/modules/udm/udm_ldap.py", line 155, in wrapper_fu ret = func( *args, **kwargs ) File "/usr/lib/pymodules/python2.6/univention/management/console/modules/udm/udm_ldap.py", line 638, in properties item.update( widget( prop.syntax, item ) ) File "/usr/lib/pymodules/python2.6/univention/management/console/modules/udm/syntax.py", line 143, in widget descr = { 'type' : widget.name( syntax, udm_property ) } File "/usr/lib/pymodules/python2.6/univention/management/console/modules/udm/syntax.py", line 60, in name MODULE.info( 'The widget name for syntax %s is %s' % ( syntax.name, self._widget_func( syntax, udm_property ) ) File "/usr/lib/pymodules/python2.6/univention/management/console/modules/udm/syntax.py", line 73, in <lambda> Widget( None, ( udm_syntax.LDAP_Search, ), [], subclasses=True, widget_func = lambda syn, prop: syn.viewonly and AttributeError: type object 'xxxxInventoryItem2Computer' has no attribute 'viewonly' univention/management/console/modules/udm/syntax.py:73 Widget( None, ( udm_syntax.LDAP_Search, ), [], subclasses=True, widget_func = lambda syn, prop: syn.viewonly and 'LinkList' or 'ComboBox' ), That is because the function gets passed the *class* and not an *instance* of that class. The viewonly attribute is only set in __init__(self). This currently only works for Prolicy references, because of the following hack in univention/management/console/modules/udm/udm_ldap.py:578 if ldap_dn: # hack reference list for policies into items if self.is_policy_module(): # create syntax object syntax = udm_syntax.LDAP_Search( filter = '(&(objectClass=univentionPolicyReference)(univentionPolicyReference=%s))' % ldap_dn, viewonly = True ) So there syntax is an *instance*. Adding a class variable "viewonly" prevents the traceback, but stil does not work, since univention/management/console/modules/udm/syntax.py:103 onyl checks for *instances*, but not for *subclasses*: elif isinstance( syntax, udm_syntax.LDAP_Search ): Since LDAP_Search with viewonly=True was the only way to generically link from one UDM object to another referenced UDM object, this functionality is now gone with all current versions of UCS-3.x, which is a huge usability regression.
*** This bug has been marked as a duplicate of bug 32046 ***