Univention Bugzilla – Bug 41053
Extended Attribute Defaults are not taken into account for already created users
Last modified: 2019-03-10 16:33:56 CET
If extended attributes are created i.e. by installing an App they are added to UDM objects once they are opened in UMC. In this case a popup informs the UMC user that additional attributes have been preconfigured - for those attributes that have only a list of allowed values. In all cases the defaults given with Extended Attributes are ignored. For the OX App Suite this leads to the following situation: * preconfigured are "Default timezone: Africa/Abidjan" and "Default language: Czech/Czech Republic" -- which makes no sense * "OX Access" is disabled, default is "premium" * "OX Display Name" is empty but a required attribute So activation of existing users for a later installed OX App Suite gets complicated...
Created attachment 7595 [details] Screenshot A screenshot is worth a thousand words :) ...
reported again by 2015112421000635
Created attachment 7742 [details] untested patch which always sets default values
Created attachment 7743 [details] patch
(In reply to Florian Best from comment #3) > Created attachment 7742 [details] > untested patch which always sets default values This patch sets the default values *always* before create() or open() - if the value is unset. (In reply to Florian Best from comment #4) > Created attachment 7743 [details] > patch This patch adds a new flag to the property which causes that in open() the default value is set - so that it gets displayed correctly in UMC. It required to extend the extended attribute schema.
Comment on attachment 7742 [details] untested patch which always sets default values self.set_defaults decides whether default values should be set. the logic in __getitem__ makes sure that it is set in the very end. The patch sets it hard, which should not be done.
Comment on attachment 7743 [details] patch This patch should consider that self.save() is called after setting the attributes - this has side effects when not using via UMC.
Created attachment 7885 [details] patch Patch against the UDM-UMC module to fill in all default values before sending the data to the frontend.
A slightly adapted patch has been applied. This probably makes the OX hooks obsolete. univention-management-console-module-udm (7.0.10-1): r79318 | Bug #41053: set default values of objects when receiving form values univention-management-console-module-udm.yaml: r79318 | Bug #41053: set default values of objects when receiving form values
Reopen: Please recheck. If i create a new user from a usertemplate, a default SAML serviceprovider with empty value is set, which fails upon saving the user object.
(In reply to Erik Damrose from comment #10) > Reopen: Please recheck. If i create a new user from a usertemplate, a > default SAML serviceprovider with empty value is set, which fails upon > saving the user object. Yes, for extended attribute (SAML serviceprovider is one) the code which reads the default values from LDAP into the UDM property instance sets always a default of [""] (which is wrong). Instead [None] should be used if no default is set. univention-directory-manager-modules (12.0.17-7): r79371 | Bug #41053: fix default value of extended attributes which don't specify a default univention-directory-manager-modules.yaml: r79372 | YAML Bug #41053
(In reply to Florian Best from comment #11) > Yes, for extended attribute (SAML serviceprovider is one) the code which > reads the default values from LDAP into the UDM property instance sets > always a default of [""] (which is wrong). Instead [None] should be used if > no default is set. This works for my test case
OK: Default values of extended attributes are set for existing users (Tested with OX, Kopano, OwnCloud, new univentionFreeAttribute) OK: YAML
<http://errata.software-univention.de/ucs/4.2/39.html> <http://errata.software-univention.de/ucs/4.2/41.html>