Univention Bugzilla – Bug 25240
[UMC]: Optionen/Checkboxen werden beim Speichern nicht übernommen
Last modified: 2016-06-15 16:20:35 CEST
Beim aktivieren von Checkboxen im Optionen-Reiter, (die z.b. bei Benutzern zusätzliche Eingabefelder hinzufügen) werden die Werte beim Speichern nicht übernommen (mit Meldung: "no changes have been made"). Wenn in den aktivierten Eingabefeldern eine Eingabe gemacht worden ist funktioniert das Speichern.
Ich denke das ist eigentlich auch vollkommen in Ordnung so da diese Optionen nur dann benötigt werden, wenn auch die entsprechenden Attribute genutzt werden. Oder nicht?
(In reply to comment #1) > Ich denke das ist eigentlich auch vollkommen in Ordnung so da diese Optionen > nur dann benötigt werden, wenn auch die entsprechenden Attribute genutzt > werden. Oder nicht? Nicht zwingend, es kann sein, dass lediglich die Objektklasse hinzugefügt wird.
*** Bug 25457 has been marked as a duplicate of this bug. ***
The mechanism to evaluate the current object classes is wrong. Only activating an option will not cause that the object class is added. Even worse is that e.g. after enabling the option "Simple authentication account" on a user account without any further modifications will cause an error: Failed to modify LDAP object ... ldapError: Object class violation: no structural object class provided The modlist in that case was: [(0, 'objectClass', 'uidObject'), (0, 'objectClass', 'simpleSecurityObject'), (2, 'objectClass', ['simpleSecurityObject', 'ucsschoolType'])] It removes all currently present object classes.
It is caused by the following code snipped in handlers/__init__.py which accidentally removes entries from the modlist: 911 » » » » » current_ocs = self.oldattr.get('objectClass') 912 » » » » » for i in ml: 913 » » » » » » if i[0] == 'objectClass' and i[2]: 914 » » » » » » » if type(i[2]) == type(''): 915 » » » » » » » » current_ocs = [ i[2] ] 916 » » » » » » » elif type(i[2]) == type([]): 917 » » » » » » » » current_ocs = i[2] 918 » » » » » » » else: 919 » » » » » » » » univention.debug.debug(univention.debug.ADMIN, univention.debug.ERROR, 'ERROR in simpleLDAP._modify: i=%s'%i) 920 » » » » » ml.append( ('objectClass', self.oldattr.get('objectClass'), current_ocs+[prop.objClass]) ) This only evaluates the last 'objectClass' entry in the modlist and removes any other changes. It doesn't consider that the modlist may contain MOD_ADD or MOD_DELETE items.
The object classes of (extended) options are now added or removed when creating and modifying objects. This code makes a lot of manual adjustments in the specific handlers unnecessary. univention-directory-manager-modules (11.0.2-30): r69514 | Bug #25240: fix object class generation; add object classes of options univention-directory-manager-modules.yaml: r69515 | YAML Bug #41266 Bug #25240
Currently ucs-test is failing due to: Compiling /usr/lib/pymodules/python2.6/univention/admin/handlers/users/user.py ... SyntaxError: ('invalid syntax', ('/usr/lib/pymodules/python2.6/univention/admin/handlers/users/user.py', 1964, 55, "\t\t\t\tnew_object_classes |= {'univentionSambaPrivileges',}\n")) and: LDAP Error: Type or value exists: modify/add: objectClass: value #0 already exists. See: http://jenkins.knut.univention.de:8080/job/UCS-4.1/job/UCS-4.1-2/job/AutotestJoin/25/SambaVersion=s3,Systemrolle=master/testReport/61_udm-users/15_user_modification_set_pwdChangeNextLogin/test/
r69535 | Bug #25240: fix typo and python2.6 syntax compatibility
FAIL: r69514 >@@ -289,7 +287,7 @@ class base(object): >- _d=univention.debug.function('admin.handlers.base.__getitem__ key = %s'%key) >+ univention.debug.function('admin.handlers.base.__getitem__ key = %s'%key) Welcome to the UCS crypt: That assignment to _d is by design. u.d.function() returns an object with a destructor (__del__), which is gets called when the last reference is dropped. In this case at the end of the calling function, which then logs a message: #!/usr/bin/python """ 09.06.16 10:55:41.399 DEBUG_INIT UNIVENTION_DEBUG_BEGIN : main1 09.06.16 10:55:41.399 MAIN ( PROCESS ) : in main1 UNIVENTION_DEBUG_END : main1 UNIVENTION_DEBUG_BEGIN : main2 UNIVENTION_DEBUG_END : main2 09.06.16 10:55:41.400 MAIN ( PROCESS ) : in main2 """ import univention.debug as ud def main1(): _d = ud.function('main1') ud.debug(ud.MAIN, ud.PROCESS, 'in main1') def main2(): ud.function('main2') ud.debug(ud.MAIN, ud.PROCESS, 'in main2') if __name__ == '__main__': ud.init('stderr', ud.FLUSH, ud.FUNCTION) ud.set_level(ud.MAIN, ud.ALL) main1() main2()
univention-directory-manager-modules (11.0.3-4): r70021 | Bug #25240: restore univention.debug.function() functionality
OK: r70021 OK: Does not work in UCS-4.0 OK: EO is added and removed OK: dpkg-query -W python-univention-directory-manager # 11.0.3-10.1402.201606141456 OK: errata-announce -V --only univention-directory-manager-modules.yaml OK: univention-directory-manager-modules.yaml
<http://errata.software-univention.de/ucs/4.1/199.html>