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

Changing default selection of column type "selection" modifies all empty fields im column #1473

Open
MI-KY opened this issue Nov 23, 2024 · 4 comments
Labels
0. Needs triage Pending approval or rejection. This issue is pending approval. bug Something isn't working

Comments

@MI-KY
Copy link

MI-KY commented Nov 23, 2024

Steps to reproduce

  1. Create a column with type "selection" and do not make it obligatory
  2. Create some entries in table and do not choose any entry of the selection (because it's not obligatory).
    Image
  3. Afterwards modify the column and make one of the entries to the default.
    Image

Expected behavior

Nothing should change in the table because the column when not obligatory should also deal with empty values.

Actual behavior

All rows in the table that have no value in the column get automatically set the default value of the column.
Image

Tables app version

0.8.1

Browser

Firefox 131.0.3

Client operating system

Linux

Operating system

No response

Web server

Apache

PHP engine version

None

Database

MariaDB

Additional info

In fact the column type "selection" should also deal with empty values - it seams like there are multiple problems that maybe arise with the fact that "empty" somewhere in the code is the first entry in the list (but not everywhere): you can't choose the first entry in the list as default because in this situation the form to insert new entries always shows an empty field for the selection.

I can open an other issue for this error if needed 🙂 .

@MI-KY MI-KY added 0. Needs triage Pending approval or rejection. This issue is pending approval. bug Something isn't working labels Nov 23, 2024
@blizzz
Copy link
Member

blizzz commented Jan 6, 2025

Thanks for reaching out @MI-KY!

Nothing should change in the table because the column when not obligatory should also deal with empty values.

Actually, Imo, what happens is what is expected. The mandatory value will receive the default value. An empty set is not a valid choice after changing the configuration like described.

An alternative scenario would be to rigidly block this operation, because there are empty values (not so UI friendly) or point out the fact that there are and they will be turned to default values. This could a message and the column edit modal as well, when ticking mandatory.

In fact the column type "selection" should also deal with empty values - it seams like there are multiple problems that maybe arise with the fact that "empty" somewhere in the code is the first entry in the list (but not everywhere): you can't choose the first entry in the list as default because in this situation the form to insert new entries always shows an empty field for the selection.

At least elaborating on it would be helpful :)

@MI-KY
Copy link
Author

MI-KY commented Jan 6, 2025 via email

@blizzz
Copy link
Member

blizzz commented Jan 7, 2025

Woah, my bad, somehow i interpreted it as in editing the column to make it mandatory.

Nevertheless, I still would argue, if you have no default before, but then change the column to have a default, it is expectable for non-chosen values to resort to the default. That's the purpose of the default value.

@MI-KY
Copy link
Author

MI-KY commented Jan 7, 2025 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending approval or rejection. This issue is pending approval. bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants