Support

Admin Tools

#36730 0 in_array(): Argument #2 ($haystack) must be of type array, string given

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
n/a
PHP version
n/a
Admin Tools version
n/a

Latest post by trogladyte on Monday, 07 March 2022 11:00 CST

trogladyte

Started building this site under, from memory, J! 4.0.1 or .2 if that makes any difference. It displays fine on www.ckdev.info/pacific and I can access the /administrator area there as well. However, since uploading to it's real home, www.pacificbreezeairsystems.com, while the frontend works OK, I get: An error has occured 0 in_array(): Argument #2 ($haystack) must be of type array, string given when trying to access the admin, thought the shell of the admin area - without menus etc - shows.

I tried downgrading PHP to 7.4 (mentioned as a possible workaround in another ticket even though the ckdev.info version is running PHP8.0) but just ended up with neither the front nor backends showing at all. Changing back to 8.0 returned things to previous state.

I turned on debug and got:

An error has occurred. 0 in_array(): Argument #2 ($haystack) must be of type array, string given Call stack # Function Location 1 ()     JROOT/plugins/system/admintools/src/Utility/BlockedRequestHandler.php:856 2 in_array()     JROOT/plugins/system/admintools/src/Utility/BlockedRequestHandler.php:856 3 Joomla\Plugin\System\AdminTools\Utility\BlockedRequestHandler->logSecurityException() JROOT/plugins/system/admintools/src/Utility/BlockedRequestHandler.php:436 4 Joomla\Plugin\System\AdminTools\Utility\BlockedRequestHandler->logBlockedRequest() JROOT/plugins/system/admintools/src/Utility/BlockedRequestHandler.php:102 5 Joomla\Plugin\System\AdminTools\Utility\BlockedRequestHandler->logWithoutBlocking() JROOT/plugins/system/admintools/src/Feature/TrackFailedLogins.php:56 6 Joomla\Plugin\System\AdminTools\Feature\TrackFailedLogins->onUserLoginFailure() JROOT/plugins/system/admintools/src/Extension/AdminTools.php:849 7 Joomla\Plugin\System\AdminTools\Extension\AdminTools->runFeature() JROOT/plugins/system/admintools/src/Extension/AdminTools.php:431 8 Joomla\Plugin\System\AdminTools\Extension\AdminTools->onUserLoginFailure() JROOT/libraries/vendor/joomla/event/src/Dispatcher.php:486 9 Joomla\Event\Dispatcher->dispatch() JROOT/libraries/src/Application/EventAware.php:111 10 Joomla\CMS\Application\WebApplication->triggerEvent() JROOT/libraries/src/Application/CMSApplication.php:900 11 Joomla\CMS\Application\CMSApplication->login() JROOT/libraries/src/Application/AdministratorApplication.php:384 12 Joomla\CMS\Application\AdministratorApplication->login() JROOT/administrator/components/com_login/src/Controller/DisplayController.php:80 13 Joomla\Component\Login\Administrator\Controller\DisplayController->login() JROOT/libraries/src/MVC/Controller/BaseController.php:735 14 Joomla\CMS\MVC\Controller\BaseController->execute() JROOT/libraries/src/Dispatcher/ComponentDispatcher.php:146 15 Joomla\CMS\Dispatcher\ComponentDispatcher->dispatch() JROOT/administrator/components/com_login/src/Dispatcher/Dispatcher.php:43 16 Joomla\Component\Login\Administrator\Dispatcher\Dispatcher->dispatch() JROOT/libraries/src/Component/ComponentHelper.php:389 17 Joomla\CMS\Component\ComponentHelper::renderComponent() JROOT/libraries/src/Application/AdministratorApplication.php:143 18 Joomla\CMS\Application\AdministratorApplication->dispatch() JROOT/libraries/src/Application/AdministratorApplication.php:186 19 Joomla\CMS\Application\AdministratorApplication->doExecute() JROOT/libraries/src/Application/CMSApplication.php:278 20 Joomla\CMS\Application\CMSApplication->execute() JROOT/administrator/includes/app.php:63 21 require_once() JROOT/administrator/index.php:32   I disabled Admin Tools by renaming the provider.php file and the admin area loads correctly. Not sure what I should download to provide you with any further info needed to troubleshoot.

trogladyte

Huh, very strange. I edited the .htaccess files with my "insert-into-every-new-htaccess" code. The site crashed and reverting to the original .htaccess didn't fix the issue. I cleared browser cache (I use Chrome and it has problematic cache) but this didn't help either. I also waited about an hour as I've found sometimes Chrome will "reset" itself  after time, but not this time.

Deleted the files and database, made a new database with a different name and reinstalled the same file I'd used previously, which then had the backend issue. Interestingly, when I logged into the backend this time there were no errors. However, editing the .htaccess file again crashed the site and no reverting to the old file made any difference.

So, doesn't look like Admin Tools was the problem - something else. Now I'll go and reinstall again.

nicholas
Akeeba Staff
Manager

If it happens again: Components, Admin Tools, Web application firewall, Configure WAF, Save & Close.

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!

trogladyte

Thanks Nicholas. It all came right on its own. Thanks for the reply! Cheers.

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!