Bug 29352 - Runtime parameter labels should not be said to be optional
Summary: Runtime parameter labels should not be said to be optional
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Reports (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Owen Leonard
QA Contact: Testopia
URL:
Keywords:
Depends on: 27644
Blocks: 29351
  Show dependency treegraph
 
Reported: 2021-10-28 14:15 UTC by Owen Leonard
Modified: 2022-06-06 20:27 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
21.11.00,21.05.05
Circulation function:


Attachments
Bug 29352: Runtime parameter labels should not be said to be optional (3.72 KB, patch)
2021-10-28 14:59 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 29352: Runtime parameter labels should not be said to be optional (3.79 KB, patch)
2021-10-28 16:56 UTC, Andrew Fuerste-Henry
Details | Diff | Splinter Review
Bug 29352: Runtime parameter labels should not be said to be optional (3.85 KB, patch)
2021-10-31 00:11 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Owen Leonard 2021-10-28 14:15:08 UTC
If you use the "Insert runtime parameter" button when editing an SQL report the modal window for defining a label says that the label is optional and will allow no label to be selected.

This is wrong. If there is no label the parameter will be treated as a generic text input. The interface should enforce the field as required.
Comment 1 Owen Leonard 2021-10-28 14:59:33 UTC
Created attachment 127061 [details] [review]
Bug 29352: Runtime parameter labels should not be said to be optional

This patch alters the form shown when using the "Insert runtime
parameter" button in SQL reports. It makes the label field required and
removes "optional" from the field hint.

To test, apply the patch and go to Reports -> Create from SQL.

 - Click the "Insert runtime parameter" button and select "Authorized
   value."
 - Clear the "parameter label" field and click "Insert parameter."
 - The form should display an error asking you to fill in the label
   field.
 - Test that the category field is also required.
 - Close the modal and select a different runtime parameter.
 - Test again that the label field is required.
 - Test that the form submits correctly when the label field is
   populated.
Comment 2 Andrew Fuerste-Henry 2021-10-28 16:56:38 UTC
Created attachment 127066 [details] [review]
Bug 29352: Runtime parameter labels should not be said to be optional

This patch alters the form shown when using the "Insert runtime
parameter" button in SQL reports. It makes the label field required and
removes "optional" from the field hint.

To test, apply the patch and go to Reports -> Create from SQL.

 - Click the "Insert runtime parameter" button and select "Authorized
   value."
 - Clear the "parameter label" field and click "Insert parameter."
 - The form should display an error asking you to fill in the label
   field.
 - Test that the category field is also required.
 - Close the modal and select a different runtime parameter.
 - Test again that the label field is required.
 - Test that the form submits correctly when the label field is
   populated.

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 3 Katrin Fischer 2021-10-31 00:11:52 UTC
Created attachment 127115 [details] [review]
Bug 29352: Runtime parameter labels should not be said to be optional

This patch alters the form shown when using the "Insert runtime
parameter" button in SQL reports. It makes the label field required and
removes "optional" from the field hint.

To test, apply the patch and go to Reports -> Create from SQL.

 - Click the "Insert runtime parameter" button and select "Authorized
   value."
 - Clear the "parameter label" field and click "Insert parameter."
 - The form should display an error asking you to fill in the label
   field.
 - Test that the category field is also required.
 - Close the modal and select a different runtime parameter.
 - Test again that the label field is required.
 - Test that the form submits correctly when the label field is
   populated.

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 4 Jonathan Druart 2021-11-02 15:54:39 UTC
Pushed to master for 21.11, thanks to everybody involved!
Comment 5 Kyle M Hall (khall) 2021-11-05 15:23:04 UTC
Pushed to 21.05.x for 21.05.05
Comment 6 Fridolin Somers 2021-11-11 01:35:05 UTC
Depends on Bug 27644 not in 20.11.x