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

Field of type text: all options, that are not unique are loaded when editing the field #154

Open
dasistwas opened this issue Feb 8, 2021 · 1 comment
Assignees
Labels

Comments

@dasistwas
Copy link
Member

How to reproduce

  1. Create a text field ( do not check unique option )
  2. Add several entries using the text field
  3. Edit the text field settings again -> Result all entry ids using the text field are shown and slows down loading the page when there are a lot of entries.

Solution: Do not load the entry ids, just make a simpler check of there are the field is not unique. Maybe similar to that query:


SELECT username, email, COUNT(*)
FROM users
GROUP BY username, email
HAVING COUNT(*) > 1
LIMIT 2


Screenshot_2021-02-08 Kompetenzportfolio - AStG99 Felder (Verwaltungsmodus)

@michaelpollak
Copy link
Collaborator

I should write a paper so this came with perfect timing... ;)
Removed most of the duplicate code for more performance. We now only check if we see a duplicate entry (has_duplicate) and prevent activation of unique.

It may be smart to keep the "print_list_of_duplicates" functionality for a popup?
Alternatively we could add a switch, under 10 duplicates show where they are, over just ignore the list and tell the user that he/she can't enable unique?

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