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

content plugins not able to insert custom fieldsets into core forms #7126

Closed
wants to merge 2 commits into from

Conversation

pollen8
Copy link
Contributor

@pollen8 pollen8 commented Jun 5, 2015

This is basically the work done in this previous PR
#4284
With the additions that Jean Marie asked for regarding multi lingual sites and the associations tab that is added.
The test instructions are the same as #4284


Background

With the implementation of using JLayout to render parameters (#2162) support for rendering custom named fieldsets ceased to be supported. This is a documented feature since at least Joomla 2.5 http://docs.joomla.org/Adding_custom_fields_to_the_article_component and is also documented to be suported in 3.1 at http://docs.joomla.org/Adding_custom_fields_to_core_components_using_a_plugin. In fact, the current core user profile plugin would break if JLayout 'joomla.edit.params' was implemented for com_users.user due to the plugin using custom named fieldsets (https://github.com/joomla/joomla-cms/blob/staging/plugins/user/profile/profiles/profile.xml#L3-L4) and the current implementation of JLayout 'joomla.edit.params' being effectively hardcoded to only render fieldsets named params and attribs (https://github.com/joomla/joomla-cms/blob/staging/layouts/joomla/edit/params.php#L15-L18).

Changes

This PR changes the behavior of JLayout 'joomla.edit.params' to render all fieldsets of the form, except those designated with the ignore_fieldsets property.

Affected by this PR are the following backend edit views:

  • com_categories.category
  • com_contact.contact
  • com_content.article
  • com_finder.filter
  • com_menus.item
  • com_modules.module
  • com_newsfeeds.newsfeed
  • com_plugins.plugin
  • com_tags.tag
  • com_templates.style

Backwards Compatibility

This PR should be 100% backwards compatible while restoring this functionality.

Testing

Apply the patch associated with this PR and review the above views to ensure that all of the currently rendered fieldsets (as tabs in Isis) remain to be rendered. Then, install and plugin that uses a custom named fieldset and ensure that it is rendered at all of the above views as described in Joomla's documentation.

A test plugin can be downloaded from https://github.com/betweenbrain/Joomla-Custom-Field-Plugin-Example/archive/test.zip

$fieldSets = $form->getFieldsets('params');

// For BC with versions < 3.2 we need to render the attribs too
$attribsFieldSet = $form->getFieldsets('attribs');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm are you sure you can remove that? See the comment one line above.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$attribsFieldSet isn't used in the layout , so pretty sure that removing it won't change rendering

@wilsonge
Copy link
Contributor

wilsonge commented Jun 5, 2015

Thank you for doing this :)

@shre001
Copy link

shre001 commented Jun 7, 2015

@this works good


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

@coolcat-creations
Copy link
Contributor

Applied Patch -> Tag edit (/index.php?option=com_tags&view=tag&layout=edit) wrong or missing language string COM_TAGS_URLS_FIELDSET_LABEL

Also could not test com_weblinks - sorry, where can i get it, couldn´t find at JED ?

Then i installed your test-plugin and the custom named fieldset were shown like expected.

So just one small issue with the tag view...


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

@zero-24
Copy link
Contributor

zero-24 commented Jun 8, 2015

Also could not test com_weblinks - sorry, where can i get it, couldn´t find at JED ?

The JED Version is broken 😄

Please try the RC2 from here: https://github.com/joomla-extensions/weblinks/releases/download/3.4.1-rc2/pkg_weblinks_dev.zip until we have a final 3.4.2 of weblinks 😃

Decoupled Extensions (later also e.g. messages, banners etc.) can be found here: http://extensions.joomla.org/extensions/extension/official-extensions/

@pollen8
Copy link
Contributor Author

pollen8 commented Jun 9, 2015

@designbengel Thanks for pointing that out. That fieldset was being added twice. It should render just a hidden field at the bottom of the form, so I've added it to the ignore_fieldsets array to avoid it being rendered as a tab.

@pollen8
Copy link
Contributor Author

pollen8 commented Jun 12, 2015

@designbengel if you could retest once more then we will have 2 successful tests :)


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

@coolcat-creations
Copy link
Contributor

Yes, now everything is fine :)


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

@zero-24
Copy link
Contributor

zero-24 commented Jun 12, 2015

RTC 😄


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

@zero-24 zero-24 added the RTC This Pull Request is Ready To Commit label Jun 12, 2015
@pollen8
Copy link
Contributor Author

pollen8 commented Jun 12, 2015

Yeah! I've got that warm Friday Joomla feeling - thanks everyone for testing

@zero-24 zero-24 modified the milestone: Joomla! 3.4.4 Jul 2, 2015
@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Jul 21, 2015
@Kubik-Rubik
Copy link
Member

Thank you @pollen8 and @betweenbrain! Merged with 580bec7.

@infograf768
Copy link
Member

Multilanguage. Associations on.
This has created an issue when editing a menu item. We get 2 associations tabs.
Possible PR here:
#7582

@infograf768
Copy link
Member

#7582 is now merged
I wonder, concerning the other places where it has been added in this PR if is not missing
$this->fieldsets = array();
before using

// Fieldsets to not automatically render by /layouts/joomla/edit/params.php
$this->ignore_fieldsets = array('item_associations');

instead of placing this code on top of file without defining $this->fieldsets.

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.

8 participants