A common experienceI couldn‘t tell you how often this problem occurs but the issue arises on The Joomla Forum™ about once a day. that people have after “successfully” updating from J! 3.10 to J! 4.0 is that their website breaks. It doesn‘t happen all the time—i.e. every time people migrate from J! 3.x to J! 4.x—but it can catch people by surprise. One of the most common reasons why websites will break is because their J! 3.10 site had one or more third-party extensions installed that used “deprecated code”Further information about potential backward compatibility changes J! 4 may be found here: Potential backward compatibility issues in Joomla 4. If you didn‘t install any third-party extensions then you can ignore the rest of this topic If you have not installed any third-party extensions in J! 3.10 then your migration to J! 4 should proceed successfully but there may be factors that do not involve “deprecated code”..
It was partly for this reason that I decided to create this website starting with J! 4.x. I did not want to spend time identify and patching old extensions that I‘d installed in a J! 3.x website years ago in the vague hope that I could uplift that site to J! 4.x without any problems.
One of the most commonly-encountered problems involves the use of isSite() and isAdmin(). It‘s probably a bit outside the average website manager‘s ability to fix these problems themselves and the rationale for triggering a fatal error (instead of a warning) is somewhat technical. The matter has been discussed at lengthhttps://github.com/joomla/joomla-cms/issues/35380 at GitHub.
Some people may be disappointed (and some people may feel angry). I don‘t have any personal feelings about the issue, myself. If, on the other hand, people would like to encourage the development team to examine the possibility of change in this regard then I suggest they head over to GitHub and join in the conversation there.
If you have the technical skill then it‘s reasonably straightforward to make the required changes to your extension(s) and re-code them without the offending isSite() or isAdmin() methods. If you do not have that skill then the quickest workaround is to restore the website from the backup that you made when you were using J! 3.10, leave the website running at J! 3.10 and get in touch with the people who wrote the extensions that break in J! 4.x to see if they have a workable solution for you. There are other workarounds that may help you login to your broken website such as to rename the offending plugin from <problem-plugin>.php to <problem-plugin>.php-old but it is beyond the scope of this article to explore these other remedies.
All things being equal—assuming no other “deprecated” or defective code—if you find references in your extensions to isSite() or isAdmin(), the corresponding change is to replace:
- isSite() with isClient('site'), and
- isAdmin() with isClient('admin').