PHP Ver 8.0 Or 8.1 Error: Count(): Argument #1 ($value) Must Be Of Type Countable|array, Null Given - Question | JoomShaper

PHP Ver 8.0 Or 8.1 Error: Count(): Argument #1 ($value) Must Be Of Type Countable|array, Null Given

C

Charlie

Extension 1 year 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.

1
10 Answers
Ofi Khan
Ofi Khan
Accepted Answer
Support Agent 1 year ago #86261

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

0
CS
Christian Stommel
Accepted Answer
1 year ago #104336

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)

0
Accepted Answer
1 year ago #104360

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

0
Ofi Khan
Ofi Khan
Accepted Answer
Support Agent 1 year ago #104383

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

0
Accepted Answer
1 year ago #104389

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.

0
Ofi Khan
Ofi Khan
Accepted Answer
Support Agent 1 year ago #104394

You are welcome 😊

Please post about it. We will check that too.

Have a great day.

0
Accepted Answer
1 year ago #104395

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

0
Ofi Khan
Ofi Khan
Accepted Answer
Support Agent 1 year ago #104398

okay, we will check.

0
CS
Christian Stommel
Accepted Answer
1 year ago #104529

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?

0
Ofi Khan
Ofi Khan
Accepted Answer
Support Agent 1 year ago #104575

Christian Stommel,

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

0