Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+4 votes
601 views
in Plugins by

Notice: Trying to access array offset on value of type null in /qa-most-active-users.php on line 122

Thanks for you help

by
You'll have to provide a link to the plugin
by
Thanks

Link https://github.com/ProThoughts/q2apro-most-active-users

Error in line 120

    $avatarImages[$username] = qa_get_user_avatar_html($user['flags'], $user['email'], $user['handle'], $user['avatarblobid'], $user['avatarwidth'], $user['avatarheight'], $avatarSize, true);

In PHP 8.0

Q2A versiĆ³n 1.8.6

Thanks for you help

1 Answer

+1 vote
by
selected by
 
Best answer

There are a few issues but I believe things should be fixed by turning this logical operator:

AND `handle`!='NULL'"

into:

AND `handle` IS NOT NULL"

In this line and this one.

Apply those changes and let me know if it seems fixed.


As the previous fix didn't fix it, then you most likely have deleted users that have asked questions and can't be found now. Follow these steps:

1. Locate this line

2. Immediate before that line (i.e. between lines 119 and 120) add the following code:

if (is_null($user)) continue;
by
thanks for your help and unfortunately it did not work
by
I thought it would be the case, but there was a chance for it to get it fixed. With the updated version of the answer, now it should be :)
by
Thanks a lot.
It has worked perfectly
...