Bug 41290 - UDM_Attribute syntax choices doesn't work with singlevalue
UDM_Attribute syntax choices doesn't work with singlevalue
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: UMC - Domain management (Generic)
UCS 4.1
Other Linux
: P5 normal (vote)
: UCS 4.1-2-errata
Assigned To: Florian Best
Philipp Hahn
:
Depends on:
Blocks: 41014
  Show dependency treegraph
 
Reported: 2016-05-18 13:06 CEST by Florian Best
Modified: 2016-09-29 17:31 CEST (History)
1 user (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 3: Simply Wrong: The implementation doesn't match the docu
Who will be affected by this bug?: 2: Will only affect a few installed domains
How will those affected feel about the bug?: 2: A Pain – users won’t like this once they notice it
User Pain: 0.069
Enterprise Customer affected?:
School Customer affected?: Yes
ISV affected?:
Waiting Support:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments
Screenshot (110.96 KB, image/png)
2016-06-16 04:03 CEST, Florian Best
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Best univentionstaff 2016-05-18 13:06:18 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.
Comment 1 Florian Best univentionstaff 2016-05-18 15:28:35 CEST
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
Comment 2 Florian Best univentionstaff 2016-06-03 10:56:23 CEST
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'
Comment 3 Philipp Hahn univentionstaff 2016-06-15 14:56:44 CEST
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.
Comment 4 Janek Walkenhorst univentionstaff 2016-06-15 16:20:40 CEST
<http://errata.software-univention.de/ucs/4.1/201.html>
Comment 5 Florian Best univentionstaff 2016-06-16 04:03:13 CEST
Created attachment 7749 [details]
Screenshot
Comment 6 Florian Best univentionstaff 2016-06-16 04:10:01 CEST
(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"}]}