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 Cloud8888
      Greetings from germany,

      i develop a shop for a customer and wanted to give them the opportunity to find products without any images so they could easily fill this empty sites.
      The problem is, that this images are placed inside a repeater.
      So the structure for the repeater field is:
      title
      bild (where 1 image can be placed)
      bildrecht (another repeater for placing the copyright  text)

      But here comes my problem.
      I designed a selector that should show me all sites where the repeater count is 0.
      Like :
      template=sorte|artikel,bilderrepeater.count=0
      But it also shows me results, where the repeater count is still 1 or even greater.
      If i save one of these bad results, the selector works fine.

      Is there a way around it ?
      I use pw 3.0.76.

       
    • By benbyf
      One of my clients found a bug when viewing the PW admin on chrome using windows - the admin tab nav doesn't appear, they could only see the tool icon either though they were a superadmin user. When viewed on Edge the tabs where present. The site is running on PW 3.0.62 with the default admin.
      I was screen sharing with my client when we found the bug, I don't actually have anyway to test this and see what's wrong myself as I dont run windows and dont currently have a cross broswer testing suite. Could someone please look into it briefly?
    • By dreerr
      In PW 3.0.80 I've experienced a bug when using multiple Page Ref fields. The Select button keeps fading in and out again. I've made a video to illustrate the problem. Any ideas how to solve this?
      video showing the error: PageRefError.mov
      greetings, d.
    • 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