? ? Pending

User tests: Successful: Unsuccessful:

avatar joomdonation
joomdonation
4 Dec 2022

Pull Request for Issue #25785.

Summary of Changes

Currently, it is not possible to provide default value for Checkboxes and Multiple List custom fields. You would get the following error if you try to do that

Save failed with the following error: The default value is invalid

This PR just fixes that wrong validation.

Testing Instructions

  1. Use Joomla 4.2
  2. Test 1: Create a Checkboxes custom field. Set multiple default value for the field, uses comma to separate these values (For example value1,value2)
  3. Test 2: Create a List custom field, set Multiple to Yes. Use a json string to set default values for the field (For example ["value1", "value2"]

Actual result BEFORE applying this Pull Request

When you try to set the field, you will get validation error:

Save failed with the following error: The default value is invalid

Expected result AFTER applying this Pull Request

No error. Field saved properly.

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:

  • No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

avatar joomla-cms-bot joomla-cms-bot - change - 4 Dec 2022
Category Administration com_fields
avatar joomdonation joomdonation - open - 4 Dec 2022
avatar joomdonation joomdonation - change - 4 Dec 2022
Status New Pending
avatar joomdonation joomdonation - change - 4 Dec 2022
The description was changed
avatar joomdonation joomdonation - edited - 4 Dec 2022
avatar joomdonation joomdonation - change - 4 Dec 2022
The description was changed
avatar joomdonation joomdonation - edited - 4 Dec 2022
avatar toivo toivo - test_item - 5 Dec 2022 - Tested successfully
avatar toivo
toivo - comment - 5 Dec 2022

I have tested this item successfully on 53b3c38

Tested successfully in Joomla 4.2.6-rc2-dev of 5 December using Wampserver and PHP 8.1.10.

BTW, the example of default values for the List custom field starts with an extra double quote: [""value1", "value2"]


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/39354.

avatar toivo
toivo - comment - 5 Dec 2022

The List field example should be ["value1", "value2"]


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/39354.

avatar joomdonation joomdonation - change - 5 Dec 2022
The description was changed
avatar joomdonation joomdonation - edited - 5 Dec 2022
avatar joomdonation
joomdonation - comment - 5 Dec 2022

Thanks @toivo . I updated testing instructions with right sample default value.

avatar viocassel viocassel - test_item - 26 Dec 2022 - Tested successfully
avatar viocassel
viocassel - comment - 26 Dec 2022

I have tested this item successfully on 53b3c38


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/39354.

avatar richard67 richard67 - change - 27 Dec 2022
Status Pending Ready to Commit
Labels Added: ?
avatar richard67
richard67 - comment - 27 Dec 2022

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/39354.

avatar fancyFranci fancyFranci - change - 27 Dec 2022
Labels Added: ?
avatar roland-d roland-d - change - 29 Dec 2022
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2022-12-29 15:00:59
Closed_By roland-d
avatar roland-d roland-d - close - 29 Dec 2022
avatar roland-d roland-d - merge - 29 Dec 2022
avatar roland-d
roland-d - comment - 29 Dec 2022

Thank you

Add a Comment

Login with GitHub to post a comment