Support

Admin Tools

#37757 Argument 1 passed to Atsystem

Posted in ‘Admin Tools for Joomla! 4 & 5’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Environment Information

Joomla! version
4.2.2
PHP version
8
Admin Tools version
n/a

Latest post by SITech on Tuesday, 20 September 2022 13:18 CDT

SITech

The test site in public_html/testnew was working OK. I had just copied AdminTools htaccess file to .htaccess. A few tests from a refreshed front end worked well. Then I tried to update the password for another superadmin with the result shown below. All access is blocked, so will revert to a backup. 

 

0 Argument 1 passed to AtsystemFeatureAlloweddomains::setAllowedDomains() must be of the type string or null, array given, called in /home/.../public_html/testnew/plugins/system/admintools/feature/alloweddomains.php on line 23

Call stack
# Function Location
1 () JROOT/plugins/system/admintools/feature/alloweddomains.php:77
2 AtsystemFeatureAlloweddomains->setAllowedDomains() JROOT/plugins/system/admintools/feature/alloweddomains.php:23
3 AtsystemFeatureAlloweddomains->isEnabled() JROOT/plugins/system/admintools/admintools/main.php:567
4 plgSystemAdmintools->loadFeatures() JROOT/plugins/system/admintools/admintools/main.php:904
5 plgSystemAdmintools->initialize() JROOT/plugins/system/admintools/admintools/main.php:84
6 plgSystemAdmintools->__construct() JROOT/libraries/src/Extension/ExtensionManagerTrait.php:234
7 Joomla\CMS\Application\CMSApplication->loadPluginFromFilesystem() JROOT/libraries/src/Extension/ExtensionManagerTrait.php:157
8 Joomla\CMS\Application\CMSApplication->loadExtension() JROOT/libraries/src/Extension/ExtensionManagerTrait.php:96
9 Joomla\CMS\Application\CMSApplication->bootPlugin() JROOT/libraries/src/Plugin/PluginHelper.php:221
10 Joomla\CMS\Plugin\PluginHelper::import() JROOT/libraries/src/Plugin/PluginHelper.php:181
11 Joomla\CMS\Plugin\PluginHelper::importPlugin() JROOT/libraries/src/Application/CMSApplication.php:738
12 Joomla\CMS\Application\CMSApplication->initialiseApp() JROOT/libraries/src/Application/AdministratorApplication.php:308
13 Joomla\CMS\Application\AdministratorApplication->initialiseApp() JROOT/libraries/src/Application/AdministratorApplication.php:165
14 Joomla\CMS\Application\AdministratorApplication->doExecute() JROOT/libraries/src/Application/CMSApplication.php:294
15 Joomla\CMS\Application\CMSApplication->execute() JROOT/administrator/includes/app.php:61
16 require_once() JROOT/administrator/index.php:32

nicholas
Akeeba Staff
Manager

You said that you are using Joomla 4.2.2 but the error message you provided indicates that you are using Admin Tools 6. However, Admin Tools 6 is NOT supported for use on Joomla 4. Please upgrade to Admin Tools 7.

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

SITech

That is a big surprise, as I had updated to Admin Tools 7 while on localhost on my PC before using transferring everything to the online test site.

Could an incorrect PHP version setting somewhere cause this to happen?

SITech

I have restored a known good backup in Joomla 4 using Kickstart. It gets me through to Restoration and clean up, with the links to front end and back end. Either option results in the same error page as the original post. 

In the restored site administrator/components/com_admintools/version.php - 

<?php
/**
 * @package   admintools
 * @copyright Copyright (c)2010-2022 Nicholas K. Dionysopoulos / Akeeba Ltd
 * @license   GNU General Public License version 3, or later
 */

// Protect from unauthorized access
defined('_JEXEC') or die;

define('ADMINTOOLS_VERSION', '7.1.10');
define('ADMINTOOLS_DATE', '2022-08-22');
define('ADMINTOOLS_PRO','1');


nicholas
Akeeba Staff
Manager

I tell you what I see on the messages I am shown — I am a software developer, not a sheer :) I will tell you what I see, what I can infer from it and what you can do about it so you can have the complete picture.

The class referenced in your error message (AtsystemFeatureAlloweddomains) only exists in the system plugin (plugins/system/admintools/feature/alloweddomains.php) which was shipped with Admin Tools 6 and earlier versions.

Admin Tools 7 and later versions use a completely new plugin structure, using the native Joomla 4 MVC and namespaces. (In fact, our software was the first Joomla software to use the new plugins architecture even before Joomla itself did. I contributed the first core Joomla plugin rewritten with the new architecture and now the core contributor Allon Moritz is working on the rest. But I digress.) That class in our plugin has been replaced with \Joomla\Plugin\System\AdminTools\Feature\AllowedDomains which now lives in the file plugins/system/admintools/src/Feature/AllowedDomains.php.

Given this data point, the fact that you did install Admin Tools 7 and the fact that there version.php file also backs up your claim we come to a simple conclusion: Joomla did NOT replace the files under plugins/system/admintools. Now, this is a known but rare problem with a simple workaround.

This is a problem which happens rarely, I first saw in 2007 (when Joomla added in-place extension upgrades) and have been reporting to the Joomla project since 2014. Nobody believed me that this problem exists until February 2022 when the lead of the Joomla Security Strike Team bumped into the same problem on a site of his own with software other than mine and without having installed my software yet. Ever since we are all trying to figure out how to reproduce this issue to solve it. For whatever reason, it was rare enough in Joomla 1.5.5 to 3.10 and extremely rare in 4.x.

The working theory is that something happens on some extension updates. The Joomla extensions installer normally removes the folders which exist in the currently installed version but not in the new version before installing the new version. In some very rare cases this does not happen and the new files are not even copied over. It's not a matter of permissions (you get an error in that case). It's not matter of caching. It's not a matter of using OPcache (it didn't exist when I first started seeing it 15 years ago). There is something else which triggers this issue, something which is very rare, but we have not found yet. For what it's worth, I did talk about it in Working around Joomla’s broken extensions updater back in March 2021 — and several tickets, public and private, the last 10 years.

Luckily, there is a simple workaround.

  1. Delete the folder plugins/system/admintools.
  2. Then install the latest Admin Tools 7 package twice in a row, without uninstalling it before or in between.

 

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

SITech

Deleting the folder was the key. After upgrading the test site to J4 and Admin Tools to 7.1.10 Pro, there were some remaining issues. I found and followed the advice about reinstalling twice. For good measure I did it three times. Admin Tools menu cleaned up and everything appeared to be OK. It took a particular kind of operation several days later to reveal the problem was still not fully fixed. When that elusive Joomla fault strikes, it sure can strike hard!

Thank you so much for your insights and help.

David

 

nicholas
Akeeba Staff
Manager

I will tell you a trick that's hard to find in the Joomla documentation. If you get class not found errors delete the file administrator/cache/autoload_psr4.php. This file keeps track of what is installed and which PHP namespaces it defines. It's normally updated whenever something is installed or updated. If it fails to update properly odd things start happening. When you delete that file, next page load in Joomla will regenerate it afresh, using the extensions information read from the disk (Joomla copies the XML manifests of every extension to predictable locations so it can perform updates and regenerate the autoload_psr4.php file).

If you are getting consistent errors after installing or updating extensions try increasing your PHP memory_limit and max_execution_time. If PHP runs out of memory or execution time the extension installation/update will never run to completion and you'll be faced with some really irritating issues.

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

SITech

Thank you, Nicholas. That's good to know.

Support Information

Working hours: We are open Monday to Friday, 9am to 7pm Cyprus timezone (EET / EEST). Support is provided by the same developers writing the software, all of which live in Europe. You can still file tickets outside of our working hours, but we cannot respond to them until we're back at the office.

Support policy: We would like to kindly inform you that when using our support you have already agreed to the Support Policy which is part of our Terms of Service. Thank you for your understanding and for helping us help you!