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

[Account] Required fields do not take into account conditions #1963

Closed
maieutiquer opened this issue Dec 3, 2021 · 2 comments
Closed

[Account] Required fields do not take into account conditions #1963

maieutiquer opened this issue Dec 3, 2021 · 2 comments
Labels

Comments

@maieutiquer
Copy link
Contributor

maieutiquer commented Dec 3, 2021

Q A
Bug report? yes
Version? 13.1

When a required field depends on another field's value, if the required field is not visible (because its condition is not met), then it's still required and the user cannot proceed

Currently, the administrator is forced to make all fields optional, which is blocking the testing of account creation and conditional fields, and is critical for us

@maieutiquer maieutiquer added the Bug label Dec 3, 2021
@YanaMIvanova
Copy link
Contributor

YanaMIvanova commented Dec 6, 2021

This is the error we get in CEP-DEV

image

So we try to reproduce it locally in Claroline. This is our configuration in Administration

image

image

This is the result from our configuration right before clicking on "Create an account" button

image

These are the errors that we get on account creation when a conditional field is mandatory, but not visible because of its parent, this seems to be related to the following issue : #1964

image

Similar errors appear when we try to close the confirmation modal, even before clicking on "Validate my registration"

image

Because of #1964 we seem to be unable to reproduce the required conditional fields bug locally

@maieutiquer
Copy link
Contributor Author

We managed to find the source of the issue, it seems to be caused by the way validations are done, it starts working if we disable validations here:

if (!ArrayUtils::has($data, 'profile.'.$field['id'])) {

image

We believe !ArrayUtils::has($data, 'profile.'.$field['id']) is not a sufficient check now that we have conditional fields

Elorfin added a commit that referenced this issue Feb 9, 2022
@Elorfin Elorfin mentioned this issue Feb 9, 2022
Elorfin added a commit that referenced this issue Feb 9, 2022
@Elorfin Elorfin closed this as completed in b4b67e9 Feb 9, 2022
Elorfin added a commit that referenced this issue Feb 9, 2022
Elorfin added a commit that referenced this issue Feb 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants