3

I am trying to use the »repeatable« form field. Right now I have this in code in the templateDetails.xml

<config>
    <fields name="params">
        <fieldset name="advanced">


            <field 
                type="repeatable" 
                label="label"
                name="stuff_list"
                default='{"stuffCSS":[], "stuffFile": []}'>

                <fields name="params">
                    <fieldset hidden="true" name="stuff_list_modal" repeat="true">
                        <field type="filelist"
                            label="stuffFile"
                            name="stuffFile"
                            hide_default="true"
                            hide_none="true"
                            directory="templates/tmpl/img" />

                        <field type="text"
                            label="stuffCSS"
                            name="stuffCSS"
                            default="" />

                    </fieldset>
                </fields>
            </field>

        </fieldset>
    </fields>
</config>

That works if I set the values for one row. But If I enter values for a second, each click of the »select« button redirects out of the edit screen, to the overview page of the template styles…

Any Help would be great!

EDIT

I just had a look in the database where the JSON string is stored correctly. So I replaced the compressed js version of /media/system/js/repeatable.js with the uncompressed version and stepped through with firebug. Result:

The javascript error is thrown in line 185:

$('select').chosen({
    disable_search_threshold : 10,
    allow_single_deselect : true
});

TypeError: $(...).chosen is not a function
http://xxx/media/system/js/repeatable.js
Line 185

EDIT #2

I just commented out the lines show above (185 - 188) and it works!

1
  • If you have managed to solve this issue yourself, please avoid writing an answer into your question as an edit. Please take the time to write your solution (and anything that you learned) as a new posted answer and then mark your answer as "accepted" by awarding it the green tick.
    – mickmackusa
    Feb 1, 2019 at 21:28

1 Answer 1

1

There are a few outstanding issues with the repeatable form in Joomla. I had a quick look into it and it seems like a bug.

Best advice I can give you is to get involved into testing pending issues (see http://issues.joomla.org/) or to check if it was not already fixed.

If you think you can fix this, submit a pull request on GitHub.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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