didhavn Posted February 7, 2017 Share Posted February 7, 2017 Hey all. I just came across a potential error in the FieldtypePassword. I have a password field added to some templates to protect the pages. However, whenever I want to save a page, I get the error of "required fiield missing"...that the password field is required and missing. But, the field is not set to required. Can anybody confirm that and/or has a solution? Best, Lukas Link to comment Share on other sites More sharing options...
adrian Posted February 7, 2017 Share Posted February 7, 2017 I think password fields are required regardless of whether the "required" checkbox is checked or not. You'll notice that the system "pass" field doesn't have required checked. You should be able to get around this though with this in your admin.php $this->wire()->addHookBefore('InputfieldPassword::processInput', null, function($event) { $event->object->required = false; }); You will probably want to limit it to your custom password field though, rather than all password fields. Link to comment Share on other sites More sharing options...
didhavn Posted February 7, 2017 Author Share Posted February 7, 2017 Thanks a lot, I'll give it a try ! 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