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

Add validation: At least 1 idp must be selected #1334

Merged
merged 1 commit into from
Dec 17, 2024

Conversation

johanib
Copy link
Contributor

@johanib johanib commented Dec 17, 2024

Prior to this change, when no idp was selected in the Entity IDP selection when publishing an Entity, the form validation would handle, and and error was thrown.

This change adds form validation that at least one IDP must be selected.

Resolves #1331

@johanib johanib requested review from pablothedude and removed request for pablothedude December 17, 2024 07:48
@johanib johanib force-pushed the release/6.2_fix_validation branch 2 times, most recently from 14a2665 to 1095c1b Compare December 17, 2024 08:36
@johanib johanib linked an issue Dec 17, 2024 that may be closed by this pull request
public function __construct(
public array $fieldNames,
?array $groups = null,
mixed $payload = null,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't it possible to omit mixed here? If you use mixed here then I would also expect a test for different types of variables.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont think payload is used, I've removed it.

@@ -15,7 +15,9 @@
{% endfor %}
{% endfor %}

{{ form_errors(form) }}
{% for error in form.vars.errors %}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this custom code construct really needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@teunfransen @quartje
Should this validation also be added this screen?
image

@quartje
Teun mentioned that unchecking Select all is similar to not selecting anything (not sure if I understood that correctly). So it might not cause functional issues? But it might not be good UX.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tested this, and it's true

Copy link
Contributor

@teunfransen teunfransen Dec 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

however, not selecting an IdP here, results in an entity in manage with the whitelisting allow all IdP to 'false'

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this custom code construct really needed?

I think this is the easiest for now. Can change to a different solution if its needed somewhere else.

Prior to this change, when no idp was selected in the Entity IDP
selection when publishing an Entity, the form validation would handle, and and error was thrown.

This change adds form validation that at least one IDP must be selected.

Resolves #1331
@johanib johanib force-pushed the release/6.2_fix_validation branch from 1095c1b to 676d082 Compare December 17, 2024 11:06
@johanib johanib merged commit db6be3e into release/6.2 Dec 17, 2024
3 checks passed
@johanib johanib deleted the release/6.2_fix_validation branch December 17, 2024 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

When publishing an entity for test, at least 1 idp must be selected
3 participants