Bug 28066 - Remove select tag's size attribute where it is 1
Summary: Remove select tag's size attribute where it is 1
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Templates (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Owen Leonard
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks: 27514
  Show dependency treegraph
 
Reported: 2021-03-31 11:36 UTC by Owen Leonard
Modified: 2021-12-13 21:12 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Medium patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
21.05.00


Attachments
Bug 28066: Remove select tag's size attribute where it is 1 (242.35 KB, patch)
2021-03-31 13:09 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 28066: Remove select tag's size attribute where it is 1 (242.00 KB, patch)
2021-03-31 13:17 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 28066: Remove select tag's size attribute where it is 1 (242.47 KB, patch)
2021-04-02 16:39 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 28066: (QA follow-up) Fix some single quote occurences (1.64 KB, patch)
2021-04-02 16:40 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-03-31 11:36:03 UTC
There are quite a few places in the templates where a <select> tag's size attribute is defined as "1." This is not necessary because the default setting for the tag is 1.

It becomes a problem when using Bootstrap because Bootstrap's CSS targets <select> tags with a size attribute:

select[multiple], select[size] {
    height: auto;
}

The goal is to be able to set a comfortable height property to <select> tags which are size 1. Removing the attribute in cases where it is equal to 1 will allow us to consistently size a <select> tag while allowing multiple selects to have the correct size.
Comment 1 Owen Leonard 2021-03-31 13:09:10 UTC Comment hidden (obsolete)
Comment 2 Martin Renvoize 2021-03-31 13:17:11 UTC
Created attachment 119049 [details] [review]
Bug 28066: Remove select tag's size attribute where it is 1

This patch removes the "size" attribute from <select> tags where the
value of the attribute is 1. The attribute is unnecessary because the
default value when the attribute is undefined is 1.

This will allow for more careful sizing of <select> tags without a size
attribute while preserving the desired behavior of <select> tags which
have a size greater than 1.

The patch modifies 83 files but makes the same minor corrections to
each. I think examining the diff is sufficent, or testing a
representative set of pages:

 - Administration -> MARC frameworks -> MARC structure -> Edit tag:
   The "Authorized value" select.
 - Patrons -> New patron: The "Library" select.
 - Reports -> Patrons with no checkouts: The "Into an
   application" selects.

If anyone would like help testing any particular template I can
follow-up.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 3 Martin Renvoize 2021-03-31 13:17:50 UTC
I scanned a few of the pages with the change and am happy it doesn't cause any regressions.

I then used 'ack' to scan the codebase for missed cases and couldn't spot any.

Signing off
Comment 4 Katrin Fischer 2021-04-02 16:39:56 UTC
Created attachment 119139 [details] [review]
Bug 28066: Remove select tag's size attribute where it is 1

This patch removes the "size" attribute from <select> tags where the
value of the attribute is 1. The attribute is unnecessary because the
default value when the attribute is undefined is 1.

This will allow for more careful sizing of <select> tags without a size
attribute while preserving the desired behavior of <select> tags which
have a size greater than 1.

The patch modifies 83 files but makes the same minor corrections to
each. I think examining the diff is sufficent, or testing a
representative set of pages:

 - Administration -> MARC frameworks -> MARC structure -> Edit tag:
   The "Authorized value" select.
 - Patrons -> New patron: The "Library" select.
 - Reports -> Patrons with no checkouts: The "Into an
   application" selects.

If anyone would like help testing any particular template I can
follow-up.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 5 Katrin Fischer 2021-04-02 16:40:00 UTC
Created attachment 119140 [details] [review]
Bug 28066: (QA follow-up) Fix some single quote occurences

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 6 Jonathan Druart 2021-04-06 13:48:28 UTC
Added a QA check

https://gitlab.com/koha-community/qa-test-tools/-/issues/49

    Issue #49 - Forbit select tag's size attribute where it is 1
Comment 7 Jonathan Druart 2021-04-06 13:59:59 UTC
Pushed to master for 21.05, thanks to everybody involved!
Comment 8 Fridolin Somers 2021-04-19 09:53:39 UTC
Enhancement not pushed to 20.11.x