User tests: Successful: Unsuccessful:
The 'repeatable' field type has a problem when used in a config form. Because the repeatable
type has an extra 'fieldset' inside the the main 'field' tag and because JForm::getFieldsets
does not exclude these specially nested 'fieldsets' and because this particular form's template doesn't use the joomla.edit.params
layout (which includes a special exemption for fieldset
tags with the repeatable
attribute set to 'true'), when you place a 'repeatable' in a config form, you will get an extra tab that you didn't want. You can test this by inserting a 'repeatable' field in any config form. For example:
<field name="test" type="repeatable" label="Test" default="{'test':['']}">
<fieldset name="test_modal" hidden="true" repeat="true">
<field name="test" type="text" label="Test" />
</fieldset>
</field>
paste this code in some appropriate location inside of any component's config.xml
and then go to the administrator and look at the form. There should be an extra tab with nothing in it. This is the tab for the 'test_modal' fieldset. Apply this patch and it will go away.
This patch is kind of a quick fix for this issue. It solves the problem and shouldn't have any side-effects. In the longer term (because other things may be affected) more changes would be nice, including:
joomla.edit.params
layout.JForm::getFieldsets
should (at least optionally) omit 'fieldset' tags nested within 'field' tags. This breaks BC but it was a kind of break of BC when 'fieldsets' began to be nested within 'field' tags in the first place because that was certainly not the expectation when JForm::getFieldsets
was written.Status | New | ⇒ | Pending |
Labels |
Added:
?
|
@photodude I agree. It might be best start over with a completely different approach to repeatable fields. Come up with a new type that works better, gradually migrate to it, and deprecate repeatable at some point in the far future. But, for now, I'd be satisfied with a fix to this little problem.
Good, I hope it turns out well. Really though, the whole issue illustrates the mess of doing this stuff the 'old fashioned' way. I'd really like to see the whole admin (and site too for that matter) remade with all rendering done on the front end using Angular, React, or something similar. Doing complex forms (and just about everything else) that way is laughably trivial compared with server-side rendering.
Category | ⇒ | Fields |
There's actually no conflict with this. It can surely be merged.
This seems to be solved already.
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2016-07-05 09:22:33 |
Closed_By | ⇒ | okonomiyaki3000 |
Anything done with repeatable field to fix it's problems is likely to break BC. The repeatable field type is totally broken for anything more than very simple fields like a text box. Once JS logic comes into play all bets are off.
(I'm still hoping for repeatable field type to be fixed some day) #6882