User tests: Successful: Unsuccessful:
When associations are enabled, the article form uses a custom field Modal_Article
to select the article.
Due to the now namespaced field the form can't no longer find the field and displays a textfield instead.
Adds the fieldprefix of com_content to the article form. The prefix from com_categories which is needed for the catid field is moved to that specific field.
@laoneo With the old way, the "own" fieldpath is already automatically preregistered. But with namespaces that isn't the case. Do you think it's possible (and should we?) to register that automatically as well? Otherwise extensions need to specify it in each of their XMLs if they use custom fields, like I do with this PR.
A field which allows to select an article from a modal
Textfield
None
Status | New | ⇒ | Pending |
Category | ⇒ | Administration com_content |
I like that idea of having a prefix per form field. The thing is that we have something like that already https://github.com/joomla/joomla-cms/blob/4.0-dev/libraries/src/CMS/Form/FormHelper.php#L198.
In your case it adds the namespace to the global prefix array or? So if there is another field with the type categoryedit but in another namespace (Joomla\Component\Foo\Administrator\Field), then it will always takes the one from the first found one, which is in our case then the one fro com_categories. It's a very rare use case, but probably we should take care of it as well.
Do you think it's possible (and should we?) to register that automatically as well?
IMO not, because then you can't use the XML file standalone. I know the use cases are rare, but like we have it now, you can use the form file in any extension and it works out of the box. All is set up by itself trough declaration in the XML file which I like.
I like that idea of having a prefix per form field.
I didn't invent that. It is already possible in J3 to add a fieldpath per field and I think it's even used in core (don't remember where). Adding a prefix per field seems to work fine as well. Don't ask me how that works
In your case it adds the namespace to the global prefix array or? So if there is another field with the type categoryedit but in another namespace (Joomla\Component\Foo\Administrator\Field), then it will always takes the one from the first found one, which is in our case then the one fro com_categories. It's a very rare use case, but probably we should take care of it as well.
Honestly, I have no clue. As said, I didn't write that feature. I just used it
Found where it is currently used in staging:
https://github.com/joomla/joomla-cms/blob/staging/administrator/components/com_banners/models/forms/banner.xml#L41
Yes, it is done globally here https://github.com/joomla/joomla-cms/blob/4.0-dev/libraries/src/CMS/Form/Form.php#L1974. So for me it is fine to merge it that way. We need to improve the Form documentation, so many hidden features.
@wilsonge good to merge.
Status | Pending | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2017-06-12 11:31:58 |
Closed_By | ⇒ | wilsonge | |
Labels |
Added:
?
|
This looks good. leaving open for now to allow Allon to give his thoughts about the autoloading of Fields