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
In com_fields, cannot set multiple default values for the field type checkbox #25785
Comments
|
Apart from the validation, having multiple default values works fine. So, if I go and set the value in MySQL manually, like...
...then the form UI works as you'd expect, making both boxes checked by default. This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/25785. |
|
I would consider it as a valid bug. Please submit PR. |
|
Thanks @Quy, I'll try code up a fix |
|
I believe this is the same as repeatable fields? You would need {value1,value2} or similar as to how it’s stored in the DB. I agree that comma separated support would be welcomed too! |
|
This issue still exist in Joomla 4b6 and below :( It would be great if you can fix it. I really need this feature. Thanks! |
|
@AndyGaskell did you ever come up with a workaround for J3 initially? I've just tried doing the same thing today, and will be wanting to do so more with Custom Fields in the future, so if you've not made some progress, I'll raise it with Enhancement Team to look at for a fix for Joomla 4.1. |
|
I would like to work on this project, can you please help me to set up the project |
|
If you are new to github - start reading documentation here: https://docs.joomla.org/Working_with_git_and_github. You can for the project in your own repo. Work on branch 4.1 dev. |
|
Hi @Siddhesh-Yadav
You can't understand Joomla in a day or in a week or in a month, it will take time to learn. Little advice from my side |
|
Is Joomla going to participate in GSOC 2022,sir? so this will be considered as a valid contribution. |
|
I'm working on it . Please guide me. |
|
@brianteeman Can I work on this issue? |


User story
I would like to add a checkbox field, with multiple checkboxes, with more than one checked by default.
Steps to reproduce the issue
Expected result
The field would save, and in new content items, it would default to have both checkboxes checked.
Actual result
Error
Save failed with the following error: The default value is invalid.
System information (as much as possible)
PHP Built On Linux hp-i5 4.15.0-55-generic #60-Ubuntu SMP Tue Jul 2 18:22:20 UTC 2019 x86_64
Database Type mysql
Database Version 5.7.27-0ubuntu0.18.04.1
Database Collation utf8_general_ci
Database Connection Collation utf8mb4_general_ci
PHP Version 7.2.20-2+ubuntu18.04.1+deb.sury.org+1
Web Server Apache/2.4.29 (Ubuntu)
WebServer to PHP Interface apache2handler
Joomla! Version Joomla! 3.9.10 Stable [ Amani ] 10-July-2019 15:57 GMT
Joomla! Platform Version Joomla Platform 13.1.0 Stable [ Curiosity ] 24-Apr-2013 00:00 GMT
User Agent Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0
Additional comments
This validation logic is in line 278 of "administrator/components/com_fields/models/field.php".
I did some searching and concluded this was a new issue, sorry if I've missed something and this is already reported or resolved.
Looking in 3.10 dev the issue seems to still be there https://github.com/joomla/joomla-cms/blob/3.10-dev/administrator/components/com_fields/models/field.php
I'm happy to try and code up a fix if people agree this is a valid bug.
I guess this is also the case for fields of the type "list" and "list of images", as they also support multiple values.
The text was updated successfully, but these errors were encountered: