Univention Bugzilla – Full Text Bug Listing |
Summary: | Validation error when using overwritten syntax class when creating new user | ||
---|---|---|---|
Product: | UCS | Reporter: | Dirk Ahrnke <da> |
Component: | UMC - Users | Assignee: | Florian Best <best> |
Status: | CLOSED FIXED | QA Contact: | Johannes Keiser <keiser> |
Severity: | normal | ||
Priority: | P5 | CC: | best |
Version: | UCS 4.2 | Flags: | best:
Patch_Available+
|
Target Milestone: | UCS 4.2-1-errata | ||
Hardware: | Other | ||
OS: | Windows NT | ||
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?: | 1: Will affect a very few installed domains | How will those affected feel about the bug?: | 4: A User would return the product |
User Pain: | 0.069 | Enterprise Customer affected?: | |
School Customer affected?: | ISV affected?: | ||
Waiting Support: | Flags outvoted (downgraded) after PO Review: | ||
Ticket number: | Bug group (optional): | ||
Max CVSS v3 score: | |||
Attachments: |
patch
patch |
Description
Dirk Ahrnke
2017-06-23 13:29:34 CEST
Hi Dirk, can you please attach the python code of the syntax class? If possible please also attach a copy of the request whichs fails: Open the developer console (e.g. Alt-Shift-I in chrome) → click on network → see the red request with response code 422 → right click → copy as curl. The syntax appears to be directly derived from http://docs.software-univention.de/developer-reference-4.2.html#udm:ea:select:dynamic : root@ucs-5084:~/sc# cat DS_Title.py class DS_Title(UDM_Objects): udm_modules = ('container/cn',) udm_filter = '(&(objectClass=organizationalRole)(ou:dn:=DS_Title))' simple = True # only one value is selected empty_value = True # allow selecting nothing key = '%(name)s' # this is stored label = '%(description)s' # this is displayed regex = None # no validation in frontend error_message = 'Invalid value' root@ucs-5084:~/sc# cat 02_create_DS_Title.sh syntax='DS_Title' base="cn=univention,$(ucr get ldap/base)" udm container/ou create --position "$base" \ --set name="$syntax" --set description='dynamischer Selektor CBS Title ' dn="ou=$syntax,$base" udm container/cn create --position "$dn" \ --set name="Dr." --set description='Dr.' udm container/cn create --position "$dn" \ --set name="PD. Dr." --set description='PD. Dr.' udm container/cn create --position "$dn" \ --set name="Prof. Dr." --set description='Prof. Dr.' udm container/cn create --ignore_exists --position "$base" \ --set name='udm_syntax' dn="cn=udm_syntax,$base" udm settings/udm_syntax create --position "$dn" \ --set name="$syntax" --set filename="DS_Title.py" \ --set data="$(bzip2 <DS_Title.py | base64)" \ --set package="$syntax" --set packageversion="1" request: curl 'http://192.168.133.168/univention/command/udm/syntax/choices/info' -H 'Cookie: UMCSessionId=6e8f2e03-b784-438c-b25d-2df6d6caed42; UMCUsername=Administrator; _pk_id.14.9d90=b91572d401a6cb17.1498219154.1.1498219174.1498219154.; _pk_ses.14.9d90=*' -H 'Origin: http://192.168.133.168' -H 'Accept-Encoding: gzip, deflate' -H 'Accept-Language: de-DE' -H 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.109 Safari/537.36' -H 'Content-Type: application/json' -H 'Accept: application/json; q=1.0, text/html; q=0.3; */*; q=0.1' -H 'Referer: http://192.168.133.168/univention/management/' -H 'X-Requested-With: XMLHttpRequest' -H 'X-XSRF-Protection: 6e8f2e03-b784-438c-b25d-2df6d6caed42' -H 'Connection: keep-alive' --data-binary '{"options":{}}' --compressed Created attachment 8964 [details]
patch
Created attachment 8965 [details]
patch
Thank you Dirk, for the fast reproducible script. @Johannes: comment #3 is missing the UCR variable which needs to be set: ucr set directory/manager/web/modules/users/user/properties/title/syntax=DS_Title univention-management-console-module-udm (7.0.10-12): r80589 | Bug #44847: fix wizards with overwritten syntax classes univention-management-console-module-udm.yaml: r80589 | Bug #44847: fix wizards with overwritten syntax classes Tested with: (In reply to Dirk Ahrnke from comment #3) > root@ucs-5084:~/sc# cat DS_Title.py > class DS_Title(UDM_Objects): > udm_modules = ('container/cn',) > udm_filter = '(&(objectClass=organizationalRole)(ou:dn:=DS_Title))' > simple = True # only one value is selected > empty_value = True # allow selecting nothing > key = '%(name)s' # this is stored > label = '%(description)s' # this is displayed > regex = None # no validation in frontend > error_message = 'Invalid value' > root@ucs-5084:~/sc# cat 02_create_DS_Title.sh > syntax='DS_Title' > base="cn=univention,$(ucr get ldap/base)" > > udm container/ou create --position "$base" \ > --set name="$syntax" --set description='dynamischer Selektor CBS > Title ' > dn="ou=$syntax,$base" > > udm container/cn create --position "$dn" \ > --set name="Dr." --set description='Dr.' > udm container/cn create --position "$dn" \ > --set name="PD. Dr." --set description='PD. Dr.' > udm container/cn create --position "$dn" \ > --set name="Prof. Dr." --set description='Prof. Dr.' > > > udm container/cn create --ignore_exists --position "$base" \ > --set name='udm_syntax' > dn="cn=udm_syntax,$base" > udm settings/udm_syntax create --position "$dn" \ > --set name="$syntax" --set filename="DS_Title.py" \ > --set data="$(bzip2 <DS_Title.py | base64)" \ > --set package="$syntax" --set packageversion="1" (In reply to Florian Best from comment #6) > Thank you Dirk, for the fast reproducible script. > > @Johannes: > comment #3 is missing the UCR variable which needs to be set: > ucr set > directory/manager/web/modules/users/user/properties/title/syntax=DS_Title OK No error is shown in the creation wizard of a new user and the modified title widget is correctly set. YAML: OK -> verified |