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

fix(display): check data after reload from self-service #543

Merged

Conversation

stonebuzz
Copy link
Contributor

@stonebuzz stonebuzz commented Jun 14, 2022

When self-service select an itil categorie from tick

form is reload and fields don't take care of new value

Only work for itilcategories_id because thatt trigger a reload of form

Fix : (portal) !6633

@stonebuzz stonebuzz added the bug label Jun 14, 2022
@stonebuzz stonebuzz self-assigned this Jun 14, 2022
@cedric-anne
Copy link
Contributor

Only work for itilcategories_id because thatt trigger a reload of form

I think this is a similar issue as #524 . We should adapt display state of containers depending on current values in form. For instance, if a rule indicates that a container should be displayed when Group in charge == "Example group", corresponding fields should be displayed in current form when this group is selected, but currently form has to be submitted and values saved to be able to apply display rules.

So, for me, the technical solution is to send an AJAX query containing all form values everytime a field is changed in the form, in order to recompute visibility of fields based on target values (i.e. array_merge($item->fields, $form_values)).

inc/containerdisplaycondition.class.php Outdated Show resolved Hide resolved
inc/containerdisplaycondition.class.php Outdated Show resolved Hide resolved
inc/containerdisplaycondition.class.php Outdated Show resolved Hide resolved
inc/containerdisplaycondition.class.php Outdated Show resolved Hide resolved
inc/field.class.php Outdated Show resolved Hide resolved
inc/field.class.php Outdated Show resolved Hide resolved
@cedric-anne cedric-anne added this to the 1.15.4 milestone Jun 21, 2022
@cedric-anne cedric-anne merged commit 3dc1434 into pluginsGLPI:develop Jun 23, 2022
@cedric-anne cedric-anne modified the milestones: 1.15.4, 1.16.0 Jun 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants