Bug 37190

Summary: form-submit.js data- attributes should use lowercase attribute names
Product: Koha Reporter: Lucas Gass (lukeg) <lucas>
Component: Architecture, internals, and plumbingAssignee: Bugs List <koha-bugs>
Status: CLOSED INVALID QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: phil
Version: Main   
Hardware: All   
OS: All   
GIT URL: Change sponsored?: ---
Patch complexity: --- Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
Circulation function:
Bug Depends on: 36246    
Bug Blocks:    
Attachments: Bug 37190: HTML data attributes are always lowercase

Description Lucas Gass (lukeg) 2024-06-25 21:31:02 UTC
If I try to add a link as a form ( see Bug 36246 ) I cannot pass the data-confirmationMsg attribute with $('.submit-form-link').data();

This is because data attribute names always get read in lowercase.
Comment 1 Lucas Gass (lukeg) 2024-06-25 21:38:02 UTC
Created attachment 168102 [details] [review]
Bug 37190: HTML data attributes are always lowercase

Test plan:
1. I don't really know how to write a good test plan for this one.
2. Review the changes, see if you agree.
Comment 2 Phil Ringnalda 2024-06-26 19:40:47 UTC
Test plan:
1. Read https://html.spec.whatwg.org/multipage/dom.html#attr-data-*
2. Verify that M is an ASCII upper alpha :)
Comment 3 Phil Ringnalda 2024-06-26 20:36:52 UTC
But... not sure why it works, but the example which landed with bug 36246 puts the message in the attribute data-confirmation-msg and that does work.
Comment 4 Phil Ringnalda 2024-06-26 20:44:15 UTC
Oh, it works because of https://html.spec.whatwg.org/multipage/dom.html#dom-dataset - jQuery 3+, data-foo-bar is then accessible as fooBar, not the least little bit confusing.