Univention Bugzilla – Bug 41290
UDM_Attribute syntax choices doesn't work with singlevalue
Last modified: 2016-09-29 17:31:25 CEST
It iterates over obj.info[syntax.attribute] which might be a string instead of a list. The result is a list with the length of that string.
univention-management-console-module-udm (6.0.11-22): r69374 | Bug #41290: version bump r69371 | Bug #41290: version bump r69369 | Bug #41290: make UDM_Attribute based syntax classes compatible with single-value fields univention-management-console-module-udm.yaml: r69376 | YAML Bug #41290
For the documenation: This was needed for the ucsschoolSchools attribute which is defines as following: class ucsschoolSchools(UDM_Attribute): udm_module = 'container/ou' udm_filter = 'objectClass=ucsschoolOrganizationalUnit' attribute = 'name' label_format = '%(displayName)s'
OK: r69374 r69371 r69369 r69376 OK: Jenkins tests OK: My tests FIXED: errata-announce -V --only univention-management-console-module-udm.yaml OK: univention-management-console-module-udm.yaml There is a reference to Bug #41291, but no description. Looks like r69487 merged a change, but did not update the YAML file. RFC: Why does PrinterProtocol(UDM_Attribute) then work without that change, which is a single valued property? Actually the UCS@school property is created "multivalue=1" The change looks fine from reading the source code change, but I have know idea what broke and what is fixed here.
<http://errata.software-univention.de/ucs/4.1/201.html>
Created attachment 7749 [details] Screenshot
(In reply to Philipp Hahn from comment #3) > RFC: Why does PrinterProtocol(UDM_Attribute) then work without that change, > which is a single valued property? > Actually the UCS@school property is created "multivalue=1" > > The change looks fine from reading the source code change, but I have know > idea what broke and what is fixed here. Yes, sorry this bug entry was really not understandable (at the time I wrote comment 2 I didn't knew the problem anymore, too). The problem was, that combobox values were filled up with rubbish ('g', 's', 'm', 'i', 't', 't', 'e') instead of ('gsmitte',) so that all values are invalid - and therefore one cannot edit an object anymore. See attachment 7749 [details]. PrinterProtocol seems to be a regular text field and doesn't have syntax/choices. Example: curl 'http://Administrator:univention@10.200.27.22/univention-management-console/command/udm/syntax/choices' -H 'Content-Type: application/json' -H 'X-Requested-With: XMLHttpRequest' --data-binary '{"options":{"syntax":"ucsschoolSchools"},"flavor":"users/user"}' returned: {"status": 200, "message": null, "result": [{"id": "g", "label": "gsmitte"}, {"id": "s", "label": "gsmitte"}, {"id": "m", "label": "gsmitte"}, {"id": "i", "label": "gsmitte"}, {"id": "t", "label": "gsmitte"}, {"id": "t", "label": "gsmitte"}, {"id": "e", "label": "gsmitte"}, {"id": "l", "label": "lib"}, {"id": "i", "label": "lib"}, {"id": "b", "label": "lib"}, {"id": "i", "label": "import"}, {"id": "m", "label": "import"}, {"id": "p", "label": "import"}, {"id": "o", "label": "import"}, {"id": "r", "label": "import"}, {"id": "t", "label": "import"}]}