Bug 50026 - [UDM HTTP API] sambaName is in template string, but is not accepted when used
[UDM HTTP API] sambaName is in template string, but is not accepted when used
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: UDM - REST API
UCS 4.4
Other Linux
: P5 normal (vote)
: ---
Assigned To: Florian Best
UMC maintainers
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2019-08-19 15:29 CEST by Daniel Tröder
Modified: 2019-10-02 16:06 CEST (History)
1 user (show)

See Also:
What kind of report is it?: Development Internal
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
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

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Tröder univentionstaff 2019-08-19 15:29:55 CEST
The add forms template object for shares/share contains 
{
..
"sambaName": "",
..
}

When the template is used with this, an error is returned:

Request argument "sambaName" The property Windows name has an invalid value: Value must not contain anything other than digits, letters, dots or spaces, must be at least 2 characters long, and start and end with a digit or letter!

Returning
{
..
"sambaName": none,
..
}
works though.

Either the template should also send "none" or the server accept "" (empty string) as is indicated in the template. The current state is inconsistent.
Comment 1 Florian Best univentionstaff 2019-08-19 19:54:47 CEST
This is a bit tricky, as the property has, default='<name>' and is a string with syntax string_numbers_letters_dots_spaces.
The create-form fills in all default values, which is in that case an empty string.

I think we should accept empty strings and treat them as equal to None.
Not sure how to fix it currently, I might have to change the syntax class.
Comment 2 Florian Best univentionstaff 2019-09-16 15:47:53 CEST
Fixed by don't evaluating defaults containig patterns.

univention-directory-manager-rest (9.0.15-6)
4f5fc4638b5c | Bug #27816: Bug #50026: fix default values of properties with replacements
Comment 3 Florian Best univentionstaff 2019-10-02 16:06:36 CEST
UCS 4.4-2 has been released:
 https://docs.software-univention.de/release-notes-4.4-2-en.html
 https://docs.software-univention.de/release-notes-4.4-2-de.html

If this error occurs again, please use "Clone This Bug".