Bug 28689 - Extra %s in alert message when saving an item
Summary: Extra %s in alert message when saving an item
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Templates (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Owen Leonard
QA Contact: Marcel de Rooy
URL:
Keywords:
Depends on: 21091
Blocks:
  Show dependency treegraph
 
Reported: 2021-07-08 13:57 UTC by Jonathan Druart
Modified: 2021-08-16 20:09 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Text to go in the release notes:
This removes an unnecessary %s in the alert message when there are errors in the cataloging add item form (for example when mandatory fields are not entered).
Version(s) released in:
21.11.00,21.05.03,20.11.09


Attachments
Bug 28689: Extra %s in alert message when saving an items (1.60 KB, patch)
2021-07-15 13:44 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 28689: Extra %s in alert message when saving an items (1.65 KB, patch)
2021-07-29 21:10 UTC, David Nind
Details | Diff | Splinter Review
Bug 28689: Extra %s in alert message when saving an items (1.75 KB, patch)
2021-07-30 09:37 UTC, Marcel de Rooy
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Druart 2021-07-08 13:57:06 UTC
On the additem form, if a subfield is marked mandatory but not filled you get:
        alertString2 += "\n- " + "%s " + MSG_MANDATORY_FIELDS_EMPTY.format(total_errors);

It displays an extra "%s"
Comment 1 Owen Leonard 2021-07-15 13:44:38 UTC
Created attachment 122860 [details] [review]
Bug 28689: Extra %s in alert message when saving an items

This patch removes an unnecessary %s in the text built to show when
there are errors in the cataloging add item form.

To reproduce, open the add item form in cataloging and click "Add item"
without filling in all mandatory fields. You should see an alert message
that contains, "- %s 1 mandatory fields empty (highlighted)"

To test, apply the patch and return to the add item form. Now when you
save an incomplete form the message should omit the %s:

- 1 mandatory fields empty (highlighted)

https://bugs.koha-community.org/show_bug.cgi?id=28690
Comment 2 David Nind 2021-07-29 21:10:24 UTC
Created attachment 123289 [details] [review]
Bug 28689: Extra %s in alert message when saving an items

This patch removes an unnecessary %s in the text built to show when
there are errors in the cataloging add item form.

To reproduce, open the add item form in cataloging and click "Add item"
without filling in all mandatory fields. You should see an alert message
that contains, "- %s 1 mandatory fields empty (highlighted)"

To test, apply the patch and return to the add item form. Now when you
save an incomplete form the message should omit the %s:

- 1 mandatory fields empty (highlighted)

https://bugs.koha-community.org/show_bug.cgi?id=28690

Signed-off-by: David Nind <david@davidnind.com>
Comment 3 David Nind 2021-07-29 21:19:03 UTC
Testing notes:
- To make a field in the add item form mandatory: edit the 952 tag and make a subfield mandatory for the bibliographic framework (Administration > Catalog > MARC bibliographic framework)
Comment 4 Marcel de Rooy 2021-07-30 09:37:56 UTC
Created attachment 123294 [details] [review]
Bug 28689: Extra %s in alert message when saving an items

This patch removes an unnecessary %s in the text built to show when
there are errors in the cataloging add item form.

To reproduce, open the add item form in cataloging and click "Add item"
without filling in all mandatory fields. You should see an alert message
that contains, "- %s 1 mandatory fields empty (highlighted)"

To test, apply the patch and return to the add item form. Now when you
save an incomplete form the message should omit the %s:

- 1 mandatory fields empty (highlighted)

https://bugs.koha-community.org/show_bug.cgi?id=28690

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 5 Jonathan Druart 2021-07-30 14:02:36 UTC
Pushed to master for 21.11, thanks to everybody involved!
Comment 6 Kyle M Hall 2021-08-06 12:20:27 UTC
Pushed to 21.05.x for 21.05.03
Comment 7 Fridolin Somers 2021-08-11 19:25:56 UTC
Pushed to 20.11.x for 20.11.09
Comment 8 Victor Grousset/tuxayo 2021-08-16 20:09:46 UTC
Not backported to oldoldstable (20.05.x). Feel free to ask if it's needed.