Having a form defined like this:
<?xml version="1.0" encoding="utf-8"?>
<form>
<fields name="custom_fields" />
</form>
Note: I've only added the fields section to explain how this issue happens. custom_fields is just an empty fields section there to allow field injection.
Before you could do this to add a field to a form fields section:
$xml = '<field type="text" name="test-field" label="Test field" />';
$form->setField(new \simpleXmlElement($xml), 'custom_fields');
And retrieve the field like:
$field = $form->getField('test-field', 'custom_fields');
Which was returning the correct field.
After this:
https://github.com/joomla/joomla-cms/pull/14737
It looks like we are now forcing that a fieldset exists on the fields section:
//fields[@name="custom_fields"]/fieldset[@name="default"]
because the new $fieldset param added to the function:
https://github.com/joomla/joomla-cms/pull/14737/files#diff-ed54af5d39d21ed9a84d28eba903bd5fR1082
So the field is never return.
I'd expect B/C. So if fieldset was not required before now it shouldn't. Before this XML worked:
<fields name="custom_fields">
<!-- fields here -->
</fields>
Now fieldset is mandatory so you need an structure like:
<fields name="custom_fields">
<fieldset name="default">
<!-- fields here -->
</fieldset>
</fields>
Joomla v3.7.0
No. I didn't test v3.7.0. I know I should be banned from the project for not doing so and everything since Windows Me is my fault. Let's skip that part. TY.
@rdeutz since that was your PR, can you have a look?
@Bakual will have a look but first I need to process the ban for roberto :-)
$fieldset should maybe have a null value but probably that removes the sense of adding such parameter?
Ping me when I'm banned so I can start being a hero on twitter 馃拑

closed because we have a PR #15981 to test
Most helpful comment
$fieldset should maybe have a
nullvalue but probably that removes the sense of adding such parameter?Ping me when I'm banned so I can start being a hero on twitter 馃拑