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

Maximum items in Data Picker not preventing to add more than allowed number of items #379

Open
1 task done
ewuski opened this issue Jan 31, 2024 · 1 comment
Open
1 task done
Assignees
Labels
bug-report Something isn't working help wanted Extra attention is needed

Comments

@ewuski
Copy link

ewuski commented Jan 31, 2024

Which Contentment version are you using?

4.6.0

Which Umbraco version are you using? For example: 10.3.2 - don't just write v10

Umbraco 10.4.0

Bug summary

Umbraco.Community.Contentment.DataPicker allows to set Maximum items limit. It is not validating the number of items selected, it only prevents selecting more items when the items are already selected.

Steps to reproduce

  1. Create a new data type using [Contentment] Data Picker (Umbraco.Community.Contentment.DataPicker)
  2. As the Data Source select a country list (.NET Countries (ISO 3166-1))
  3. Set Maximum items property to a desired value higher than 0 (low value will be more useful in this case)
  4. Assign the data type to a doc type or element type property
  5. Save the data type and the doc type, create a content based on the doc type in the Content section and go to add the value in the content.
  6. Click Add button to add values to the property of newly created data type, select more than the value set in Maximum items limit of the data type.
  7. Save

More than allowed Maximum items values can be selected if selected in one go or if selected before the limit has been reached. They also can be saved. No validation is present to disallow selection of more items than set in Maximum items.

Expected result / actual result

It should not allow to save the property with more items than set in the Maximum items
It should prevent selection or it should throw a validation error if more items selected.

Do you have Umbraco ModelsBuilder enabled?

  • Yes, it is enabled.

What browsers are you seeing the problem on?

Chrome

@ewuski ewuski added the bug-report Something isn't working label Jan 31, 2024
@ewuski
Copy link
Author

ewuski commented Jan 31, 2024

Maximum 3 items allowed:

Zrzut ekranu 2024-01-31 o 20 00 03

Selecting items:

Zrzut ekranu 2024-01-31 o 20 04 39

Saved items:

Zrzut ekranu 2024-01-31 o 20 04 54

which are more than 3 Maximum allowed.

@leekelleher leekelleher added the help wanted Extra attention is needed label Feb 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-report Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants