1

I have component in Joomla 2.5. I am trying to make it to compatible with Joomla 3.x.

After few changes in the code, I get an error:

Cannot extend from interface JController

Then I change the code

From:

class drAffiliatesControllerDefault extends JController {

To:

class drAffiliatesControllerDefault extends JControllerAdmin {

After this, it's returning an error:

0 Cannot access protected property ApplicationAdministrator::$session

When I am adding the code

JControllerLegacy::display();

it's returning an error:

0 Using $this when not in object context

can anyone suggest me how can I upgrade my component to 3x

1

The link of FFrewin should answer your question. This here is just an additions about the upcoming change in Joomla 3.8. We changed the libraries to namespaces.

So your controller should extend then \Joomla\CMS\MVC\Controller\BaseController

the model \Joomla\CMS\MVC\Model\BaseModel

and the views \Joomla\CMS\MVC\View\HtmlView.

You will find all classes here https://github.com/joomla/joomla-cms/tree/staging/libraries/src/MVC. The old classes do still work as we created an alias for them https://github.com/joomla/joomla-cms/blob/staging/libraries/classmap.php#L38

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.