com_fields : checking for availability of component, correcting 2 fatal errors#12646
com_fields : checking for availability of component, correcting 2 fatal errors#12646wilsonge merged 2 commits intojoomla:stagingfrom
Conversation
| ); | ||
|
|
||
| if (JComponentHelper::getComponent('com_contact')->params->get('custom_fields_enable', '1')) | ||
| if (JFields::isEnabled() && JComponentHelper::getComponent('com_contact')->params->get('custom_fields_enable', '1')) |
There was a problem hiding this comment.
Can't we use just JComponentHelper::isEnabled('com_fields') ?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
and same for the plugin
There was a problem hiding this comment.
for plugins you can use JPluginHelper::isEnabled('fields', 'whatever')
|
Modified test instructions. This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/12646. |
|
@laoneo Please test. That is one of the multiple PRs to correct com_fields. |
|
I have tested this item ✅ successfully on c05c148 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/12646. |
|
As @stevejburge tested this successfully (mentioned in #11833) merging this with two good tests |
…al errors (joomla#12646) * com_fields : checking for availability of component, correcting 2 fatal errors * Simplifying checks + others
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
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