2

I'm trying to make my news module modification working with Joomla 4. My module is calling custom fields and I use this autoloader below to make it work in Joomla 4. Can you tell me what is the proper way to use autoloader on Joomla 4 instead of using this legacy one?

JLoader::register('FieldsHelper', JPATH_ADMINISTRATOR . '/components/com_fields/helpers/fields.php');
2

This should still work in 4.0 but will break in 5.0. You are advised to use fully qualified class names. Remove JLoader::register() call and instead add a use statement:

use Joomla\Component\Fields\Administrator\Helper\FieldsHelper;
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.