Have a field on the menu form that itself has a subfield with a fieldlist.
Form renders correctly.
Form renders a fixed text field and does not render any other fields on that tab.
Current Joomla with very little on it.
I am attempting to convert an existing component from J3 to J4. The component adds menu items and has a default.xml file in the view to define additional menu parameters. These worked just fine in J3. The xml file defines a number of additional tabs that are rendered on the menu edit screen. On one tab I have a field which has fields under it and one of these fields has a fieldset. When the menu system renders this tab it chokes and simply displays a textbox. I am attaching a screen image of the menu edit output so you can see what I mean.
Below is a stripped down version of the xml markup that illustrates the problem.
<fields name="params">
<fieldset name="request">
<field name="listid"
type="tables"
label="LIST_LABEL"
description="LIST_DESC"
/>
</fieldset>
<fieldset name="basic" label="LIST_OPTIONS">
<!-- other fields in here -->
<field name="list_elements"
type="modalrepeat"
label="LIST_ELEMENTS_LABEL"
description="LIST_ELEMENTS_DESC"
>
<fields name="params">
<fieldset modal="true" name="list_elements_modal" repeat="true">
<field name="show_in_list"
type="listfields"
size="30"
multiple="true"
label="ELEMENTS_HEADING"
/>
</fieldset>
</fields>
</field>
</fieldset>
</fields>
I have identified where the problem is occurring and a modification I made to the code which solves it for me. I do not know what other impact this might have so I am hopeful the experts can weigh in.
The problem file is layouts/joomla/edit/params.php at line 113 where it determines if the field has children.
Existing code:
$hasChildren = $xml->xpath('//fieldset[@name="' . $name . '"]//fieldset[not(ancestor::field/form/*)]');
My code change that is working for me:
$hasChildren = $xml->xpath('//fieldset[@name="' . $name . '"]//fieldset[not(ancestor::field/form/*)]//fieldset[not(ancestor::field/fields/*)]');
As I am working on a component that is not of my original design it is very possible the xml markup is wrong and if so I would be happy to hear what it should look like.
Otherwise I await your feedback.
Labels |
Removed:
?
|
Labels |
Added:
No Code Attached Yet
|
I inherited this component so don't know the history of why, but removing the fields doesn't solve the problem. I get the same result. But thanks for the suggestion.
Anyone?
Labels |
Added:
bug
|
Why do you wrap the 3rd, inner fieldset into a
<fields name="params">
in your xml? Maybe that’s the problem?