Skip to content

com_fields : checking for availability of component, correcting 2 fatal errors#12646

Merged
wilsonge merged 2 commits intojoomla:stagingfrom
infograf768:com_fields_patch_1
Oct 31, 2016
Merged

com_fields : checking for availability of component, correcting 2 fatal errors#12646
wilsonge merged 2 commits intojoomla:stagingfrom
infograf768:com_fields_patch_1

Conversation

@infograf768
Copy link
Copy Markdown
Member

@infograf768 infograf768 commented Oct 30, 2016

Pull Request for Issue #12645
and for issue #12633

Summary of Changes

Prevents fields menu and sidebar from displaying when com_fields is not enabled.
Displays a Warning if the fields system plugin is disabled.
Corrected 2 fatal errors JFolder and JFile not found when saving a custom field.
Alpha ordered and modified the xml_description language string for the system plugin as the custom fields will NOT display if disabled.

Testing Instructions

Patch
Disable the component com_fields in Extensions Manager=>Manage
result: menus and sidebar do not show (Users, contacts, content)

Then enable it again and disable the fields system plugin. Display the fields manager
Result : a Warning is displayed in the manager
screen shot 2016-10-31 at 08 03 22

Create a new custom field and save. Before patch fatal error, after, it saves fine

TODO: change the fields manager and fields group manager title to fit the component concerned

);

if (JComponentHelper::getComponent('com_contact')->params->get('custom_fields_enable', '1'))
if (JFields::isEnabled() && JComponentHelper::getComponent('com_contact')->params->get('custom_fields_enable', '1'))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can't we use just JComponentHelper::isEnabled('com_fields') ?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

the new jfields ii created takes care of both the component and the plugin, but, yes, we could separate these and use the new jfields to take only care of the plugin, in order to use it only for the message in the manager. will look tomorrow.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

and same for the plugin

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

for plugins you can use JPluginHelper::isEnabled('fields', 'whatever')

@infograf768
Copy link
Copy Markdown
Member Author

Modified test instructions.


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

@joomla-cms-bot joomla-cms-bot added the Language Change This is for Translators label Oct 31, 2016
@infograf768
Copy link
Copy Markdown
Member Author

@laoneo
@brianteeman
@andrepereiradasilva
@coolcat-creations
@rdeutz

Please test. That is one of the multiple PRs to correct com_fields.

@andrepereiradasilva
Copy link
Copy Markdown
Contributor

I have tested this item ✅ successfully on c05c148

Works as described.


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

@stevejburge stevejburge mentioned this pull request Oct 31, 2016
@wilsonge
Copy link
Copy Markdown
Contributor

As @stevejburge tested this successfully (mentioned in #11833) merging this with two good tests

@wilsonge wilsonge merged commit 490674a into joomla:staging Oct 31, 2016
@zero-24 zero-24 added this to the Joomla 3.7.0 milestone Oct 31, 2016
nvyush pushed a commit to nvyush/joomla-cms that referenced this pull request Nov 9, 2016
…al errors (joomla#12646)

* com_fields : checking for availability of component, correcting 2 fatal
errors

* Simplifying checks + others
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.

5 participants