?
avatar phproberto
phproberto
12 May 2017

Steps to reproduce the issue

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:
#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.

Expected result

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>

Actual result

Now fieldset is mandatory so you need an structure like:

<fields name="custom_fields">
    <fieldset name="default">
        <!-- fields here -->
    </fieldset>
</fields>

System information (as much as possible)

Joomla v3.7.0

Additional comments

See #14737

avatar phproberto phproberto - open - 12 May 2017
avatar joomla-cms-bot joomla-cms-bot - change - 12 May 2017
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 12 May 2017
avatar phproberto phproberto - edited - 12 May 2017
avatar phproberto
phproberto - comment - 12 May 2017

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.

avatar Bakual
Bakual - comment - 12 May 2017

@rdeutz since that was your PR, can you have a look?

avatar rdeutz
rdeutz - comment - 12 May 2017

@Bakual will have a look but first I need to process the ban for roberto :-)

avatar phproberto phproberto - change - 12 May 2017
The description was changed
avatar phproberto phproberto - edited - 12 May 2017
avatar phproberto
phproberto - comment - 12 May 2017

$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 ?

avatar phproberto
phproberto - comment - 12 May 2017

isformbrokenbyrobertdeutz

avatar joomla-cms-bot joomla-cms-bot - change - 12 May 2017
The description was changed
avatar joomla-cms-bot joomla-cms-bot - edited - 12 May 2017
avatar franz-wohlkoenig franz-wohlkoenig - change - 12 May 2017
Status New Discussion
avatar franz-wohlkoenig franz-wohlkoenig - change - 12 May 2017
Category Fields
avatar rdeutz rdeutz - change - 12 May 2017
The description was changed
Status Discussion Closed
Closed_Date 0000-00-00 00:00:00 2017-05-12 11:24:28
Closed_By rdeutz
avatar rdeutz rdeutz - close - 12 May 2017
avatar rdeutz
rdeutz - comment - 12 May 2017

closed because we have a PR #15981 to test

Add a Comment

Login with GitHub to post a comment