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

NEW Provide clear UX validation errors when violating unique index #11558

Merged

Conversation

GuySartorelli
Copy link
Member

@GuySartorelli GuySartorelli commented Jan 15, 2025

Tested locally with both MySQL and MariaDB

For an index with only a single column, it will show an error message next to the form field for that column:
image

For an index with multiple columns, it will show a single error message at the top of the edit form:
image

Issue

@GuySartorelli GuySartorelli marked this pull request as draft January 15, 2025 00:37
@GuySartorelli GuySartorelli force-pushed the pulls/5/unique-index-validation branch from e4794a7 to e68f111 Compare January 15, 2025 01:32
@GuySartorelli GuySartorelli marked this pull request as ready for review January 15, 2025 01:34
@GuySartorelli GuySartorelli force-pushed the pulls/5/unique-index-validation branch from e68f111 to de3255c Compare January 15, 2025 02:22
@GuySartorelli GuySartorelli marked this pull request as draft January 15, 2025 02:37
@GuySartorelli GuySartorelli force-pushed the pulls/5/unique-index-validation branch from de3255c to ea864a4 Compare January 15, 2025 02:59
@GuySartorelli GuySartorelli marked this pull request as ready for review January 15, 2025 03:03
Copy link
Member

@emteknetnz emteknetnz left a comment

Choose a reason for hiding this comment

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

Tested locally, works well for SiteTree, DataObject, and content block in react context

src/ORM/Connect/DBConnector.php Show resolved Hide resolved
src/ORM/DataObjectSchema.php Outdated Show resolved Hide resolved
src/ORM/Connect/MySQLiConnector.php Show resolved Hide resolved
src/ORM/Connect/MySQLiConnector.php Outdated Show resolved Hide resolved
@GuySartorelli GuySartorelli force-pushed the pulls/5/unique-index-validation branch from ea864a4 to 9f7d803 Compare January 15, 2025 20:26
@emteknetnz emteknetnz merged commit 7e6c809 into silverstripe:5 Jan 15, 2025
17 checks passed
@emteknetnz emteknetnz deleted the pulls/5/unique-index-validation branch January 15, 2025 21:10
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.

2 participants