User tests: Successful: Unsuccessful:
Pull Request for Issue #23659.
We have the subform field and don't need the repeatable field anymore. This removes that field as requested in #23659 and previously done in continga@71f831d.
This PR removes the repeatable field and adds a method to the update script which converts the existing repeatable fields to the subform field type. For all repeatable fields it inserts new fields and links those to the subfields field. To not display them twice in the edit view, the category for the new fields is always set to "none". Please notice that a field in the repeatable field of type "number" can NOT be converted, since we don't have a field of type number. You can however change this later on to integer for example.
public function update()
{
require_once JPATH_ADMINISTRATOR . '/components/com_admin/script.php';
\JoomlaInstallerScript::uninstallRepeatableFieldsPlugin();
}
Status | New | ⇒ | Pending |
Category | ⇒ | Administration com_admin Language & Strings SQL Installation Postgresql Front End Plugins |
Labels |
Added:
?
?
|
Labels |
Added:
?
|
Priority | Medium | ⇒ | Urgent |
Labels |
Added:
?
Removed: ? |
Labels |
Added:
?
Removed: ? |
The steps 2 and 3 of the testing instruction are only needed if the patch is applied via patchtester.
The PR works fine for me. But there is a small problem.
I had two repeatable fields, customer and supplier, both with name and address, some as text, some as textarea.
After running the update script I have customer and supplier as subfields. This is correct..
And I have 2 fields "name" and 2 fields "address". This also is correct. But confusing.
A possible solution could be to set the name of the repeatable as a prefix i.e. "customer-name".
There are some problems with UX, but not in scope of this PR.
Thank you for picking this up for J4. Due to circumstances, I was not able to do this yet. Thanks!
When I try to apply the patch through the patch tester I get an error:
The patch could not be applied because it conflicts with a previously applied patch: installation/sql/mysql/joomla.sql
But I have not other patches applied... what can I do?
@drmenzelit reset patchtester
Thank you @brianteeman ! It worked now.
The PR works. But the same as @chmst wrote: the repeatable was converted to subfields, but two new text fields (the two I created inside the repeatable) appear outside the subfield. I don't know if this is an expected behavior...
@drmenzelit yes, unfortunately that is expected behavior.
So I will mark your PR as good. But it is the contrary of UX or self explaining. I will try to identify the UX issues.
I have tested this item
I have tested this item
@drmenzelit yes, unfortunately that is expected behavior.
By the way that's not "unfortunately". That's a good thing. That's a good feature, it means you can re-use the same fields as part of different subfields :)
@AndySDH yes, it is a good feature. But the subfields feature is not self explaining. For example in the field list, you cannot see which field is sub field only or in which subfields it is used.
The raping of the categoy for indicating "this is subfield only" is not self explaining too. So there should be some further improvements for the subfields feature but this is not in scope of this PR
Yes, that's true. It could definitely be useful to mark in some better way which subfields are only meant to be used as subfields. For now what I did is put them in a dedicated fieldgroup.
But the good thing about this, is that you can even use a field in two ways at the same time: you can both use it as a normal field somewhere, and as a subfield somewhere else!
Labels |
Added:
?
Removed: ? |
Status | Pending | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2020-03-18 14:53:13 |
Closed_By | ⇒ | wilsonge |
Thank you for picking this up! @Hackwar