Support

Admin Tools

#35915 Warning: Invalid argument supplied for foreach() in .../administrator/components/com_admintools/src/Model/HtaccessmakerModel.php on line 305

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 on Wednesday, 03 November 2021 20:17 CDT

pjdevries

I get the following warning when accessing the Control Panel:

Warning: Invalid argument supplied for foreach() 
in .../administrator/components/com_admintools/src/Model/HtaccessmakerModel.php
on line 305

 It's a fresh Joomla 4.0.3 installation, with Admin Tools the first and only installed 3rd party extension. A hardened .htaccess was generated as part of the initial configuration procedure.

nicholas
Akeeba Staff
Manager

You have tried to remove all entries from “User agents to block” instead of setting “Block access from specific user agents” to No? This would do it.

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!

pjdevries

Thanx for the swift response.

I can see why it would, but no, I did not remove all entries from "User agents to block". The good news is however, I had to redo the installation for other reasons and the problem does not reoccur there. Unfortunately I have been too hasty in removing the site with the issues, so I can not delve into the cause of the problem any further. Sorry for that.

nicholas
Akeeba Staff
Manager

The warning comes from the line which iterates through the list of blocked user agents. I believe it was indeed empty. However, when it's empty and you visit the WAF Configuration page again it will appear re–populated with the defaults but at this point these items are not saved in the database just yet. If you click Save & Close they will be saved, replacing the previously empty list, fixing this problem.

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!

pjdevries

Thanx for the additional explanation. I'm sure you must be right, so I guess I cleared the list unintentionally. I'll be more careful next time.

nicholas
Akeeba Staff
Manager

No problem!

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!

System Task
system
This ticket has been automatically closed. All tickets which have been inactive for a long time are automatically closed. If you believe that this ticket was closed in error, please contact us.

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!