Bug 29352

Summary: Runtime parameter labels should not be said to be optional
Product: Koha Reporter: Owen Leonard <oleonard>
Component: ReportsAssignee: Owen Leonard <oleonard>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: fridolin.somers, kyle
Version: Main   
Hardware: All   
OS: All   
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
Bug Depends on: 27644    
Bug Blocks: 29351    
Attachments: Bug 29352: Runtime parameter labels should not be said to be optional
Bug 29352: Runtime parameter labels should not be said to be optional
Bug 29352: Runtime parameter labels should not be said to be optional

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 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