Skip to main content

Error updating to Joomla4: Call to Undefined method Joomla\CMS\Application\AdministratorApplication::isAdmin()

| Gianluca Gabella | Joomla!
share on facebook share on twitter share on linkedin

Index:


It is update time in Joomla and the first errors are starting to appear. Let's see how to deal with the most common update errors from version 3 to version 4.

Joomla4 has finally been available for a few weeks now and many webmasters are trying their hand at an upgrade. This is a 'major' version upgrade, so caution is never enough: always make a good backup and perhaps follow a detailed guide.

Despite all possible precautions something can still go wrong and in 99% of cases it is the fault of some extension that you have not upgraded to a Joomla 4 compatible release.

The pre-upgrade check is a very useful tool and it is essential to study it carefully: all extensions that are not compatible or that could create problems once the upgrade is complete will be marked. If only a few extensions are installed on your site, the check will probably not take long. If you have dozens of extensions installed (maybe even old ones) then checking to see if the developer has released a Joomla4 compatible version will be more time consuming. The important thing is NOT TO SKIP THIS STEP. Updating Joomla while leaving non-compatible plugins active can literally bring down your site.

I updated Joomla, but the site exploded

You thought you had done every possible check imaginable, you updated everything that could be updated, but something went wrong. It happens, don't panic.

One of the most common errors that are popping up from updates is the following: Joomla updates regularly, you have your beautiful Joomla 4, but as soon as you enter the control panel (or from the frontend) you get the following error message: 0 - Call to undefined method Joomla\CMSApplication\AdministratorApplication::isAdmin()

errore joomla4 call to undefined method

The error is quite common because the isAdmin() function is one of those that with the move to version 4 has been deprecated and replaced by the isClient() method, by the way already available for Joomla 3.x version.

This is therefore the first big clue we have: it is the fault of an outdated extension.

How do I understand which extension generates the error?

This is the most complex part: there are potentially dozens of extensions that can generate this error and the above message does not give much information about it.

And this is where the Joomla core comes to our rescue: it is possible to enable a debug mode, which aims to give us as much information as possible to find the source of the error.

Enabling it is in theory simple: from the top menu -> system -> global configuration -> "System" tab -> Debug settings and click "YES" under "system debug".

abilitare debug

The problem is that no matter what page you go to, the undefined method error will always pop up, and you will have no way to change anything.

To solve the problem we have to edit by hand the configuration.php file located in the root of your joomla site.

We then access the site files via FTP (for example with a client like FileZilla or with the file manager of your hosting) and change the string "debug" from 0 to 1:

 

stringa debug

Save the file and reload it via FTP to the site root.

Now update the Joomla control panel page. If everything went well, new information about your error will appear:

call stack

Let's go and analyse the output. The call stack is (simply put) a column of 'calls' that are active at a given time and whose execution has not finished. Basically, it is a train of calls that helps us understand where the error originated.

In the image above we see that most of the calls are part of the joomla core:

  • JROOT/administrator/* is the joomla administration folder
  • JROOT/libraries/* is the folder with the standard libraries used by joomla

the only call that is not part of the core is number one:

JROOT/plugins/system/canonicallinks/canonicallinks.php:35

refers to a system plugin called 'canonical links'. There is therefore a good chance that the extension generating the problem is just that.


The only way to solve this is to disable the plugin so that it is not loaded.

There are cases, however, in which it is not possible to 'simply' disable plugins: for example, if the page does not load correctly, as in this case.

We therefore have two solutions:

  1. Access the plugin page directly without going through the main page. Simply edit the URL of your site by hand by adding after administrator:

    www.youtsite.it/administrator
    turn it into:
    www.yoursite.it/administrator/index.php?option=com_plugins


  2. If the error also occurs on the plugin page, the plugin must be disabled by hand, either via FTP or via Database. In this guide you will find out how to do this step by step:

    FIND OUT HOW TO MANUALLY DISABLE A JOOMLA PLUGIN

If everything went well the plugin is correctly disabled and by updating the joomla page everything will be back to normal.

joomla4ok

Have fun with the brand new Joomla4!


If you liked this article, please share it!

share on facebook share on twitter share on linkedin
condividi su Facebookcondividi su Twittercondividi su LinkedIncondividi su WhatsAppcondividi su Telegram