Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Client validation bug for uniqueInPage and password repeat #619

Open
klodeckl opened this issue Nov 28, 2024 · 3 comments
Open

Client validation bug for uniqueInPage and password repeat #619

klodeckl opened this issue Nov 28, 2024 · 3 comments

Comments

@klodeckl
Copy link

If the client side validator is active for profile edit the following validation errors occur:

  • uniqueInPage validator fires but the username (email because of fillEmailWithUsername is set) is not changed
  • password repeat validator fires with “Field could not be validated” (validationErrorGeneral) but the password is not changed (no value in password and password_repeat

Setting plugin.tx_femanager.settings.edit.validation._enable.client = 0 seems to help (server validation is fine?).

femanger current github main branch version
TYPO3 12.4.23
PHP 8.2

@sbusemann
Copy link
Contributor

Can you please post your config for the validation?

@klodeckl
Copy link
Author

Here it is:

plugin.tx_femanager {
        settings.new {

                # validation of user input values
                # possible validations for each field are: required, email, min, max, intOnly, lettersOnly, uniqueInPage, uniqueInDb, date, mustInclude(number,letter,special,space), mustNotInclude(number,letter,special,space), inList(1,2,3), captcha, sameAs(password)
                # see manual for an example how to add custom serverside and clientside validation
          
          fillEmailWithUsername = 1
          
                validation {
                        # Enable clientside Formvalidation (JavaScript)
                        _enable.client = 1

                        # Enable serverside Formvalidation (PHP)
                        _enable.server = 1
                        institutionType {
                                required = 1
                                #mustNotInclude = special,space
                        }
                        company {
                                required = 1
                                #uniqueInDb = 1
                                #mustNotInclude = special,space
                        }
                        address {
                                required = 1
                        }
                        zip {
                                required = 1
                        }
                        city {
                                required = 1
                        }
                        country {
                                required = 1
                        }
                  state {
                                required = 1
                        }
                        stackDiscipline {
                                required = 1
                        }
                  stackArea {
                                required = 1
                        }
                        stackLms {
                                required = 1
                        }
                  username {
                                required = 1
                                uniqueInPage = 1
                    uniqueInDb = 0
                          email = 1
                                #mustNotInclude = special,space
                        }
                        email {
                                required = 0
                                #email = 1
                                #uniqueInPage = 1
                        }
                        password {
                                #required = 1
                                #min = 10
                                #mustInclude = number,letter,special
                        }
                        usergroup {
                                #inList = 1,2,3
                        }
                        privacy {
                                required = 1
                        }
                }
        }
}

plugin.tx_femanager.settings.edit < plugin.tx_femanager.settings.new

@klodeckl
Copy link
Author

klodeckl commented Nov 28, 2024

I have also set

plugin.tx_femanager.settings.edit.misc.keepPasswordIfEmpty = 1
plugin.tx_femanager.settings.edit.validation.password.required = 0
plugin.tx_femanager.settings.edit.validation.password_repeat.required = 0

to be able to update the profile without changing the password.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants