awesomolocity Posted July 29, 2019 Share Posted July 29, 2019 Okay, so I'm making some modifications to Ryan's LoginRegister module. Currently, I'm attempting to add a couple html attributes to the form. (Specifically "data-abide" - see Zurb Foundation). On line 515 of LoginRegister.module, I saw $form->attr('id', 'LoginRegisterForm'); so I attempted doing the same thing with my attribute, but it didn't work. $form->attr('data-abide', ''); Upon searching, it looks like the cause of the removal of attributes with no values is the getAttributesString() function in wire/core/inputfield.php, specifically line 1135 // skip over empty attributes if(!is_array($value) && !strlen("$value") && (!$value = $this->attr($attr))) continue; Now, I realize that I could just comment out that line and it works perfectly fine if I do. However, that doesn't really seem ideal since it'll break on updates. My question is: how should I go about doing this? Just comment out the line and hope Ryan removes it in the future? Or another way I hadn't thought of? Link to comment Share on other sites More sharing options...
Robin S Posted July 29, 2019 Share Posted July 29, 2019 2 hours ago, awesomolocity said: Or another way I hadn't thought of? You could update to the latest dev. Support for empty data attributes was added in this commit. 1 Link to comment Share on other sites More sharing options...
awesomolocity Posted July 29, 2019 Author Share Posted July 29, 2019 2 hours ago, Robin S said: You could update to the latest dev. Support for empty data attributes was added in this commit. Oh hey thanks. That's a pretty easy fix. Lol Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now