Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

php8 Error in Backend -> Option #29

Open
st-anton opened this issue Jul 28, 2021 · 4 comments
Open

php8 Error in Backend -> Option #29

st-anton opened this issue Jul 28, 2021 · 4 comments

Comments

@st-anton
Copy link

st-anton commented Jul 28, 2021

Hi, when stepping over to php8, the backend options page cannot be opened because of a error: count(): Argument #1 ($var) must be of type Countable|array, null given
Frontend does work and adding new attachments does work as well.

@st-anton st-anton changed the title php8 Error in Backend -> Oprion php8 Error in Backend -> Option Jul 28, 2021
@peterhulst
Copy link

peterhulst commented Feb 22, 2023

You can correct that easily.
File: /administrator/components/com_attachments/controllers/params.php
Line:
if (count($errors = $this->get('Errors'))) {
replace that line with:
$errors = $this->get('Errors');
if (!IS_NULL($errors) and count($errors)) {

@Kimball31
Copy link

Kimball31 commented Feb 22, 2023

@peterhulst, don't you mean !IS_NULL($errors), not !IS_NULL($count)?

        $errors = $this->get('Errors');
        if (!is_null($errors) and count($errors)) 
        {
            JError::raiseError(500, implode("\n", $errors) . ' (ERR 118)');
            return false;
        }

@peterhulst
Copy link

You are right. I have corrected it.

@mckillo
Copy link
Contributor

mckillo commented Aug 20, 2024

This issue is fixed and it could be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants