I'm trying to use the Joomla subform field with multiple="true" on (instead of using the old modal repeatable method).

My problem is that the data is not saving to the database. I have read multiple examples but cannot see what I'm doing wrong.

If I turn off multiple="true" then the subform saves data as a JSON string to the database just fine. When I turn it back on, it won't save no matter what I try.

My issue is basically this one, but there were no solutions and I don't have enough reputation to simply comment on it: Why doesn't my subform field data get saved?

My component XML:

<field name="list_links_url" 
        label="Subform Field" 
        description="Subform Field Description"

Subform XML:

<?xml version="1.0" encoding="UTF-8"?>
        <field name="link"
            description="Enter a URL" 

FYI - Brand new install of Joomla 3.6.5 and PHP 7.0.10

Any help would be greatly appreciated.

  • There is nothing wrong with the code you posted above. Can you say where you are using it? Frontend or backend? In config or passing it to a controller task? etc. – jamesgarrett Feb 20 '17 at 7:53

In your table's bind function, add this:

if ( ( !empty( $array[ 'list_links_url' ] ) && ( is_array( $array[ 'list_links_url' ] ) ) ) ) {
            $this->_jsonEncode[] = "list_links_url";
  • This is the closest to a solution I've come across, thanks for taking the time. In the end I've chosen to use the old repeatable method but this is still useful, thanks. – sigil Apr 24 '17 at 18:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.