didhavn

Bug in FieldtypePassword

Recommended Posts

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

pwpass_requirederror.jpg

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By AndZyk
      Hello,
      can somebody tell me, if it is possible to get the clear password of an InputfieldPassword inside a module, before it is encrypted?
      I have made a custom module which sets the password of an Auth0User after the hook publishReady with a random generated password. When I try to get a clear password from a InputfieldPassword in this hook, it is of course already encrypted (which is of course good). But is there a hook before the encryption, so I could get it one time to send it to Auth0?
      If there is not such thing, could be another possibility to add a jQuery script to get the value directly from the DOM and save it somewhere temporarily?
      I know this might be an unusual question, but I would appreciate any feedback. 
      Regards, Andreas
    • By Robin S
      Password Generator
      Adds a password generator to InputfieldPassword.

       
      Usage
      Install the Password Generator module.
      Now any InputfieldPassword has a password generation feature. The settings for the generator are taken automatically from the settings* of the password field.
      *Settings not supported by the generator:
      Complexify: but generated passwords should still satisfy complexify settings in the recommended range. Banned words: but the generated passwords are random strings so actual words are unlikely to occur.  
      https://github.com/Toutouwai/PasswordGenerator
    • By theoretic
      Hi everyone! And thanks again for a perfect product.
      It appears there's a small bug in the implementation of fieldset. If we rename a field of type FieldsetTabOpen, the auto-created field of type FieldsetTabClose won't auto-rename. E.g. if we create a fieldset called "noises", two fields will be created -- "noise" (type: FieldsetTabOpen) and "noise_END" (type: FieldsetTabClose). And when we later rename the field "noise" to "acoustics", the field "noise_END" still keeps its name. The auto-generated field description will also remain unchanged.
      This is only a minor bug, but removing it could make the Processwire even better. Thanks in advance!
    • By darrenc
      What I did
      edit the default 'body' field (textarea, ckeditor) field > body > input: "enable ACF" checked "yes" by default field > body > input: "extra allowed content" ... The instructions indicate "Example: img[alt,!src,width,height]" in order to enable a tag with attributes you want to allow through the filtering.
      a[class] I wrote the above expecting that now i would be able to class my a tags in the editor, maybe make one a "button" style or whatever. However, this doesn't actually work as it seems Extra Allowed Content doesn't actually do what it indicates.
      I've tried a dozen different variations and after googling here and seeing some responses in other threads, I think this should be addressed. The box is a nice way to enable a few attributes the user might want to allow for clients or themselves, I don't see why one would require making a module or going above and beyond the tools and text areas already provided in order to simply allow a few attributes.  I could turn ACF Off entirely, but that doesn't really address the problem: I want to filter the input for clients but still configure some tweaks that I deem would enhance and not break the site.
      Simply: it's there, it's nice to have, should work right, but it doesn't seem to. Help?
       
       
    • By Anna
      How to FieldtypePage category as blog?
      Home
          - receptek
                - recept
                - recept
                - recept
          - kategorak
               - kategoria
               - kategoria
               - kategoria
      recept.php <?php foreach($page->kat_page as $item) { //$item = kategoria echo "<h3>$item->title</h3>"; //kategoria->recept??? }