Bug 8521 - Error in warning message when deleting list
Summary: Error in warning message when deleting list
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Lists (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Owen Leonard
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-07-30 14:06 UTC by Owen Leonard
Modified: 2015-06-04 23:33 UTC (History)
4 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:


Attachments
Bug 8521 - Error in warning message when deleting list (3.77 KB, patch)
2014-07-16 12:31 UTC, Owen Leonard
Details | Diff | Splinter Review
Signed off patch (3.92 KB, patch)
2014-07-25 02:48 UTC, Ian Beardslee
Details | Diff | Splinter Review
[PASSED QA] Bug 8521 - Error in warning message when deleting list (4.03 KB, patch)
2014-08-03 20:54 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 2012-07-30 14:06:41 UTC
If you have a list containing more than 20 items and you try to delete it the warning message gives the wrong count:

The list <list name> is not empty.
It has 20 entries.
Use the "Confirm" button below to confirm deletion. 

The count is always 20. The same error occurs in the staff client and OPAC.
Comment 1 Owen Leonard 2014-07-16 12:31:10 UTC Comment hidden (obsolete)
Comment 2 Ian Beardslee 2014-07-25 02:48:43 UTC Comment hidden (obsolete)
Comment 3 Katrin Fischer 2014-07-25 06:41:15 UTC
Comment on attachment 30064 [details] [review]
Signed off patch

Review of attachment 30064 [details] [review]:
-----------------------------------------------------------------

::: koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt
@@ +234,5 @@
>          [% IF ( paramsloo.noshelfnumber ) %]<div class="dialog alert">ERROR: No list number given.</div>[% END %]
>  		[% IF ( paramsloo.need_confirm ) %]
>  		<div class="dialog alert">The list <i>[% paramsloo.need_confirm %]</i> is not empty.
> +            [% IF ( paramsloo.single ) %]
> +                <br />It has <b>[% paramsloo.count %]</b> entry.

The <b> will split up this sentence on translation - is it really necessary here? :)
Comment 4 Katrin Fischer 2014-08-03 20:54:49 UTC
Created attachment 30523 [details] [review]
[PASSED QA] Bug 8521 - Error in warning message when deleting list

When deleting a list the operation is blocked if there are items still
on the list, and the interface shows a warning which includes a count of
the items on the list. This count is broken for lists containing more
items than the number specified in the numSearchResults system
preference.

This patch corrects the item count to use an actual count of the total
number of results, not the total number of results in the first page of
results.

The template change to the staff client copies some language logic from
the OPAC template for dealing with a single number of list entries.

Test in both the OPAC and the staff client.

Check the number specified in the numSearchResults system preference and
locate or create a list containing more than that number of items. Try
to delete the list. You should receive a warning message stating the
correct total number of items on the list.

Test also with a list which contains fewer than numSearchResults
entries, and a list which contains zero entries.

Signed-off-by: Ian Beardslee <ian@catalyst.net.nz>

Tested Public and Private lists with 0, 5 & 25 entries, Public with 40 and Private with 45.  Working as expected.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Works as described, passes tests and QA script.
Comment 5 Tomás Cohen Arazi 2014-08-05 23:51:48 UTC
Patch pushed to master.

Thanks Owen!