Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Needs to specify the fieldset name 'params' #7922

Closed
wants to merge 1 commit into from

Conversation

alexvanniel
Copy link
Contributor

The fieldset 'params' needs to specified here, otherwise all fieldsets of the entire form will be rendered here, causing all kinds of unwanted behaviour like displaying the layout for the basic data twice and thus rendering the editor unsable for instance. This looks like a regression to me. Unless I am doing something wrong. However, when specifying JLayoutHelper::render('joomla.edit.params'); I expect to see only the layout for the params fieldset and not the other fieldsets like basic data and metadata.

The fieldset 'params' needs to specified here, otherwise all fieldsets of the entire form will be rendered here, causing all kinds of unwanted behaviour like displaying the layout for the basic data twice and thus rendering the editor unsable for instance. This looks like a regression to me. Unless I am doing something wrong. However, when specifying JLayoutHelper::render('joomla.edit.params'); I expect to see only the layout for the params fieldset and not the other fieldsets like basic data and metadata.
@zero-24
Copy link
Contributor

zero-24 commented Sep 23, 2015

Can we have a simple usecase or example with a core or 3Party component?

Also I'm not sure with the B/C handeling here maybe @Bakual can help here?


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/7922.

@alexvanniel
Copy link
Contributor Author

I tried to see if I could reproduce the problem that I came across in my own component with a core component like com_content or com_weblinks but somehow I could not get it to display the same problems I encountered. It appears there have been some changes to the way the params fieldset is displayed. I could not find any documentation or mention on why this was done and what changes to a component needs to be made. Maybe I am missing the point entirely here but when I upgraded to 3.4.4 my component started to show the basic form fields twice for instance. Comparing this code with the old code showed that somehow the params layout is now not filtered with 'params' as argument. So, if anyone can shed some light on this... As said, I may be doing something wrong. I would like to know what that is... if at all..

@alexvanniel
Copy link
Contributor Author

I did find out that the problems I experienced without this proposed change, would go away when I would remove the "name" attribute from my first fieldset in my form xml. So basically, the layout will display all fieldsets that have a name attribute set in the form xml. Is that supposed to happen that way? I do see that com_contact, com_content and such don't have an attribute name for the first fieldset set.

@Bakual
Copy link
Contributor

Bakual commented Sep 23, 2015

You can define the ignore_fieldsets arraykey in the $displayData and specify which fieldsets should not be rendered by the JLayout. See https://github.com/joomla/joomla-cms/blob/staging/layouts/joomla/edit/params.php#L21-L23

I think that is what we do in our core extensions.
The JLayout is meant to show all fieldsets, not only the params one. That's why there is a foreach later one. If we only wanted to show a single fieldset, then that foreach would be useless 😄

Closing as it is intended behavior and the issue can be solved by excluding speciifc fieldsets from being rendered.

@Bakual Bakual closed this Sep 23, 2015
@alexvanniel alexvanniel deleted the patch-5 branch September 24, 2015 07:22
@alexvanniel
Copy link
Contributor Author

Sorry to comment in this closed pull request but I did notice that ignore_fields is not used even though it is picked up... is this something that is being worked on or has the use of ignore_fields been "forgotten" c.q. omitted?

@Bakual
Copy link
Contributor

Bakual commented Sep 24, 2015

It's used in https://github.com/joomla/joomla-cms/blob/staging/layouts/joomla/edit/fieldset.php (which is called by the params JLayout)
In the params JLayout itself it is indeed useless and the lines could be removed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants