1. Fabrik 3.9 has been released. If you have updated Joomla to 3.9, this is a required update.
    Dismiss Notice

Password plugin : empty value allways checked even if hidden

Discussion in 'Community' started by dranreb_38, May 31, 2018.

  1. dranreb_38

    dranreb_38 New Member

    Level: Community
    Hello
    I use password plugin in a form, but in a conditional way. When password is not required, I hide it in the form (using Javascript on another element). I have a non-empty validation but I use Validate hidden toggle to put the validation off in this case. But password presence is allways checked in any case... (even if I remove non-empty validation)
    Worked as expected in 3.5, but now I'm using 3.8.1 release, and this problem is new...
    How to deal with ?
    Thx
    Dran
     
  2. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Community
    Not sure how it worked as expected in 3.5, as I didn't add that "validate hidden" option till 3.7.

    The issue is that the "validate hidden" option is only applied to validation rules. But the password element isn't using a validation rule, it's using a built in element validation method, which always runs. And I don't see any

    I'd have to add a specific "Validate if hidden" option to the password element itself.

    -- hugh
     
  3. dranreb_38

    dranreb_38 New Member

    Level: Community
    Thanks for answering, Hugh.
    I also dont know why it seemed to work before. Suppose checking was different in the element itself.
    For sure I understand that my non-empty validation is useless now, as always checked in element.
    Seems to me the element should simply accept password to be empty, as this validation can be checked by a validation rule...
    When you say "I'd have to add...", do you mean you'll change something in a near new release ? If not, can you suggest me a modification in element code to do that ?
    Thx a lot
    Dran
     
  4. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Community
    The internal validation doesn't specifically check for empty, it just checks that the confirmation matches, and optionally runs the J! password rule (which you set in the password element options), which is what is rejecting empty strings.

    If you'd like to take out a sub for a month, I'll add it.

    -- hugh
     
  5. dranreb_38

    dranreb_38 New Member

    Level: Community
    Thank you, but the thing is that setting J! password rule option to yes or no doesn't change anything... I allways get the message : "Vous devez entrer un mot de passe" (in french because my site is in french...)
    Dran
     
  6. cheesegrits

    cheesegrits Support Gopher Staff Member

    Level: Community
    Oh, yeah, sorry, our code does test for empty. So I'd also have to add an option to allow empty passwords as well, if you needed that. Note that Joomla doesn't allow empty passwords, although I get that some folk use the password element for things other than J! passwords.

    So yeah, if you take out a sub, I can add those features for you.

    -- hugh
     

Share This Page