Bug 24518 - Partner filtering does not work in IE11
Summary: Partner filtering does not work in IE11
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: ILL (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Andrew Isherwood
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-01-27 11:28 UTC by Andrew Isherwood
Modified: 2020-11-30 21:47 UTC (History)
6 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:
20.05.00, 19.11.05, 19.05.10


Attachments
Bug 24518: Fix IE11 partner filtering (3.76 KB, patch)
2020-01-27 12:06 UTC, Andrew Isherwood
Details | Diff | Splinter Review
Bug 24518: Fix IE11 partner filtering (3.81 KB, patch)
2020-03-09 16:45 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 24518: Fix IE11 partner filtering (3.91 KB, patch)
2020-03-18 11:31 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Isherwood 2020-01-27 11:28:05 UTC
We're doing something like this to hide options that are not applicable to the current filtering string:

$('#my_select_option').hide();

This applies the following CSS rule to the <option> element:

display: none

It turns out that IE won't hide option elements. So, that's annoying.

We have a couple of choices here. We could either clone the entire list of partners, filter out the ones that don't match the search string and then use the remainder to repopulate the <option> elements. Or we could wrap the <options> in something that IE11 will apply display:none to, such as a <span> or something. However, this will lead to something that is semantically incorrect for HTML5, since a <select> can only have <option> or <optgroup> as it's children.

Despite the first option feeling a bit gnarly, I'm going to go for that as it will fix the problem and not lead to broken markup.
Comment 1 Andrew Isherwood 2020-01-27 12:06:18 UTC
Created attachment 97974 [details] [review]
Bug 24518: Fix IE11 partner filtering

This patch adopts the approach detailed in comment #1.

It also fixes a couple of additional minor bugs relating to the ILL
partner list:
- Exclude partners with no email address, we cannot use them
- Quote the "value" attribute to avoid warnings displayed by IE, they
should be quoted anyway!

Test plan: USE IE11
- Apply the patch
- Define 3 ILL partner patrons (patrons in the category that has a code
that matches the <partner_code> value in the ILL config). One patron
should have no email address, the other two should have an email address
- Navigate to "Place request with partners" for an ILL request
- TEST: Observe that the patron with no email address is not displayed
- Try filtering the list
- TEST: Observe that the list filters correctly
Comment 2 Owen Leonard 2020-03-09 16:45:29 UTC
Created attachment 100395 [details] [review]
Bug 24518: Fix IE11 partner filtering

This patch adopts the approach detailed in comment #1.

It also fixes a couple of additional minor bugs relating to the ILL
partner list:
- Exclude partners with no email address, we cannot use them
- Quote the "value" attribute to avoid warnings displayed by IE, they
should be quoted anyway!

Test plan: USE IE11
- Apply the patch
- Define 3 ILL partner patrons (patrons in the category that has a code
that matches the <partner_code> value in the ILL config). One patron
should have no email address, the other two should have an email address
- Navigate to "Place request with partners" for an ILL request
- TEST: Observe that the patron with no email address is not displayed
- Try filtering the list
- TEST: Observe that the list filters correctly

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 3 Jonathan Druart 2020-03-18 11:31:32 UTC
Created attachment 100953 [details] [review]
Bug 24518: Fix IE11 partner filtering

This patch adopts the approach detailed in comment #1.

It also fixes a couple of additional minor bugs relating to the ILL
partner list:
- Exclude partners with no email address, we cannot use them
- Quote the "value" attribute to avoid warnings displayed by IE, they
should be quoted anyway!

Test plan: USE IE11
- Apply the patch
- Define 3 ILL partner patrons (patrons in the category that has a code
that matches the <partner_code> value in the ILL config). One patron
should have no email address, the other two should have an email address
- Navigate to "Place request with partners" for an ILL request
- TEST: Observe that the patron with no email address is not displayed
- Try filtering the list
- TEST: Observe that the list filters correctly

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Did not test on I11, but regression tested ok
Comment 4 Martin Renvoize 2020-03-18 17:52:57 UTC
Nice work everyone!

Pushed to master for 20.05
Comment 5 Joy Nelson 2020-04-03 20:24:58 UTC
backported to 19.11.x for 19.11.05
Comment 6 Lucas Gass 2020-04-13 17:17:04 UTC
backported to 19.05.x for 19.0.10
Comment 7 Hayley Pelham 2020-04-19 23:59:42 UTC
Minor/normal patch will not be backported to 18.11.x series