PHP ver 8.0 or 8.1 Error: count(): Argument #1 ($value) must be of type Countable|array, null given - Forum | JoomShaper
Staff replied Extensions

PHP ver 8.0 or 8.1 Error: count(): Argument #1 ($value) must be of type Countable|array, null given

Asked by Charlie 4 years ago Last activity 2 years ago

If the system switch to php 8.0 or php 8.1, Joomla 4

the login module through exception error

count(): Argument #1 ($value) must be of type Countable|array, null given

JROOT/templates/shaper_gazette/html/mod_login/default.php:69

Need to fix asap.

11 replies

Ofi Khan Staff

Hello Charlie

Please share where the issue occurs. Then I will check and share with the developers. Gazette template compatibility is not checked with PHP 8. Please share a screenshot of error with debug mode on to understand it better. Take a screenshot and share via any platform. For example: Lightshot

Best regards

Christian Stommel

Hello! I have the same problem with the template Helixultimate. As long as I don't log into the protected area under PHP 8.0 or higher, everything is fine.

If I log in, the page is also available. However, after logging out, I receive the same error message and can no longer access the page.

I can only access the page again after I have reset PHP to 7.4 at my provider.

Is there a solution here?

Translated with www.DeepL.com/Translator (free version)

Deleted user
3 years ago · edited

I had got the same problem after installing "opus" and updating to the newest version of joomla and pb 3.

"count(): Argument #1 ($value) must be of type Countable|array, null given"

my php was set on 8.. with downgrade to 7.4 it works

Ofi Khan Staff

Hello guys,

I know the solution of this issue now. Please go to this file
templates/your_template/html/mod_login/default.php and find this line

if (count($twofactormethods) > 1) : 

Then change it to

if (count((array)$twofactormethods) > 1) : 

Best regards

Deleted user

Thank you Ofi. The Page is back, but witrh Slider Problems. In Edit-View the Slider is gone.

its not that important.. but when we fix one thing, we get new Issues.

Have a nice day.

Ofi Khan Staff

You are welcome 😊

Please post about it. We will check that too.

Have a great day.

Deleted user

Thank you.. you can recover it after installing your quickstart of opus.. it was a clean install.

maybe your developer team will fix it with the nxt update of this template.

regards

Ofi Khan Staff

okay, we will check.

Christian Stommel

Hallo and many thanks for the tip. If I see this correctly, then there is no corresponding line in the "default.php" in the Template Helixultima that can be changed?

Ofi Khan Staff

Christian Stommel,

Your issue looks different. Please post a new question. We will help you with it.

Log in to reply.