I am trying to write a Joomla plugin to add fields to the user group admin form.
I have previously written plugins that have added a new tab to the user form. This is possible by having a plugin with the
onContentPrepareForm method, and calling
$form->loadFile() to inject the XML for the new tab of fields into the existing form.
As I say, this works well for the user form, but does absolutely nothing at all on the group form.
I have written a plugin, referenced the form name as
com_users.group, and called
$form->load() to inject my form XML. The XML is valid and no errors are reported, but the new form fields do no show up.
I guess that this is because the user form is already defined with multiple tabs, whereas the group form is much simpler and is not.
I've also tried adding the individual fields to the existing form (with without creating a new tab) by using
$form->setField(), but this also isn't having any effect.
In either case, when I do a
var_dump($form) after injecting my fields, I can see the new fields in the form's XML object structure, but they are not in the right place in the structure, which I guess is why they're not showing up.
Can anyone help point me in the right direction here? It's getting quite frustrating.