-
Problem report
-
Resolution: Unresolved
-
Trivial
-
6.0.41rc1, 7.0.14rc1, 7.2.8rc1, 7.4.0rc1 (master)
-
S25-W22/23
Problem description: Currently, item form validation does not allow to save an item with preprocessing step "Javascript" that has an empty "Script" field, but if field "Script" contains only empty spaces or only newlines (technically the script is still empty) the form gets successfully submitted.
Not sure if there is a reason do add a Javascript preprocessing step with only empty spaces in the "Script" field, but, at least to be consistent with Script parameter in Browser item and Script item configuration forms, having only empty spaces or newlines in Script field should not be allowed.
Steps to reproduce:
- Open the list of items for any existing host
- Press "Create item" buton
- Fill in item key and item name fields
- Switch to Preprocessing tab
- Add a preprocessing step "Javascript" with only empty spaces or only newlines
- Attempt to submit the form
Result: form successfully submitted. No validation errors observed
Expected: form should not be submitted. An error stating that field "Script" cannot be empty should be displayed.