I'm curently developing a (free) Custom Joomla 4.x component. Now im struggeling while implementing Custom Fields support for my first (and currently only) context. The issue is that the "Fields" tab does not get showed in the backend when editing a "location". I've followed the guide by astrid on how to create a component.

It's the third time I create a component for joomla 4 and as far as i can see i've done everything similar to the others i've already created. I did not spot the issue here.

Could please someone check my repo here: GitHub and tell me what i am doing wrong?

thanks for your help


I've added the mentioned changes (thanks for that) and updated the repo, still no effect on the edit view for a location...

class FootballmanagerComponent extends MVCComponent implements FieldsServiceInterface


public function validateSection($section, $item = null)
        if (Factory::getApplication()->isClient('site') && $section === 'form')
            return 'footballmanager';

        if ($section !== 'footballmanager' && $section !== 'form')
            return null;

        return $section;

    public function getContexts(): array
        Factory::getApplication()->getLanguage()->load('com_footballmanager', JPATH_ADMINISTRATOR);

        $contexts = array(
            'com_footballmanager.location' => Text::_('COM_FOOTBALLMANAGER_LOCATION'),
//          'com_helloworld.categories' => JText::_('JCATEGORY')

        return $contexts;

What I see when i add fields for this component there is no "category" input in the fields that looks a bit suspicious to me.

  • 1
    Fix your model's preprocessForm() method so it always calls the parent method.
    – Sharky
    Jul 10, 2023 at 5:58
  • OMG - that was a dumb mistake - thanks @Sharky - can you create an answer so I can mark it as solution?
    – Marco
    Jul 13, 2023 at 15:51

1 Answer 1


At first glance you're missing the getContexts and validateSection methods which you should have in your extension class. Your extension class also needs to implement Joomla\CMS\Fields\FieldsServiceInterface.

The Joomla 3 MVC Tutorial description of how to include custom fields is at https://docs.joomla.org/J3.x:Developing_an_MVC_Component/Adding_Custom_Fields and the changes from this to Joomla 4 are described at https://docs.joomla.org/J3.x:Developing_an_MVC_Component/Upgrading_to_Joomla4#com_fields.

  • Thanks for pointing that out - i've done the mentioned changes (but please note as i said the other components this where also missing and it workied (some kinda).. Updated my repo - still want work
    – Marco
    Jul 6, 2023 at 4:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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