User tests: Successful: Unsuccessful:
This change add the possibility to save multiple values of FieldList as JSON.
Create using JForm a list with multiple value enabled like:
<field multiple="true" name="options" type="list" label="COM_TEST_FORM_LBL_OPTIONS" description="COM_TEST_FORM_DESC_OPTIONS" hint="COM_TEST_FORM_LBL_OPTIONS">
<option value="0">COM_TEST_PRODUCTS_OPTIONS_0</option>
<option value="1">COM_TEST_PRODUCTS_OPTIONS_1</option>
<option value="2">COM_TEST_PRODUCTS_OPTIONS_2</option>
</field>
Then add into save() function in models:
$data['options'] = json_encode($data['options']);
You can save multiple values as JSON into database
Status | New | ⇒ | Pending |
Category | ⇒ | Libraries |
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2022-03-23 09:52:52 |
Closed_By | ⇒ | laoneo | |
Labels |
Added:
?
Removed: ? |
Sorry that it took so long to respond. While this is a nice addition for Joomla, it should be added to version 4 as it is a new feature. Can you rebase it to the 4.2-dev branch? In the meantime I'm closing the pr, when ready please reopen so we can properly test it. Thanks for your contribution, making Joomla better.