8: Trying to access array offset on value of type null ?action=profile;u=1

Started by rcane, February 28, 2022, 08:52:08 AM

Previous topic - Next topic

rcane

This is a new, persistent, message that keeps showing on users' trackings.

What is the u=1?  I see some that don't have the action= after null.

Shades.

ShadesWeb.com - Custom Logos - My Themes on SMF | My Themes on ShadesWeb
https://shadesweb.com

BikerHound.com - Sniffing out the road ahead
https://bikerhound.com

Dream as if you'll live forever; Live as if you'll die today. - James Dean


rcane

Quote from: Doug Heffernan on February 28, 2022, 09:10:29 AMIndeed. That would be the user id of the main/super admin.

Yep, I tested my maintenance account and recognized the user number.  But, why would that be an error in user # (for example) 874?

Doug Heffernan

Quote from: rcane on February 28, 2022, 09:26:45 AM
Quote from: Doug Heffernan on February 28, 2022, 09:10:29 AMIndeed. That would be the user id of the main/super admin.

Yep, I tested my maintenance account and recognized the user number.  But, why would that be an error in user # (for example) 874?

I am not sure that I understand what you mean.

rcane

Sorry that was poorly written; I inspected the page and found u= while in different accounts.  I presumed that it was the user id.

but, checking other users' account errors I see them replete with this, sans any user id's.

8:Trying to access array offset on value of type null ?

If I hover on it it's just the domain/index.php?

Diego Andrés

Does it tell you anything else, like the file or function causing it?

SMF Tricks - Free & Premium Responsive Themes for SMF.

rcane

Quote from: Diego Andrés on February 28, 2022, 10:04:46 AMDoes it tell you anything else, like the file or function causing it?

No, the "Below is a list of all the recent errors that this user has generated/experienced." just has the date/time and that error.  the "?" is hoverable to see where it was going.  that's it.

Aleksi "Lex" Kilpinen

Check your error log through the Admin control panel. It will most likely list those same errors, with a bit more details.
Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

rcane

Quote from: Aleksi "Lex" Kilpinen on February 28, 2022, 11:48:55 AMCheck your error log through the Admin control panel. It will most likely list those same errors, with a bit more details.

seems to point to subs-shoutbox.php

Tyrsson

How long has this been happening and what version of php are you running? Has your host made any changes to server config lately, updated php versions?
PM at your own risk, some I answer, if they are interesting, some I ignore.

Tyrsson

That error referrers to trying to access an index for a variable that should be an array but is actually null.
<?php
declare(strict_types=1);
$array null;
if(
$array['some_key']) {
    
// will cause the same error that you are having, tested in php version 7.4.9

Basically somewhere in the code it reads something like the above, there is a check for something that is not the expected type, which would be an array, but instead its null.

My first suggestion would be to check your current version of Php that is running on your server instance, then make sure that your current version of SMF supports that version.
PM at your own risk, some I answer, if they are interesting, some I ignore.

Aleksi "Lex" Kilpinen

Quote from: rcane on February 28, 2022, 08:34:50 PMseems to point to subs-shoutbox.php
This would also point a modification, there's no shoutbox in a vanilla SMF.
Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

Tyrsson

Quote from: Aleksi "Lex" Kilpinen on March 01, 2022, 01:06:14 AM
Quote from: rcane on February 28, 2022, 08:34:50 PMseems to point to subs-shoutbox.php
This would also point a modification, there's no shoutbox in a vanilla SMF.
You know, that is actually something (maybe already is) that should be required in the mods and themes site, they should be required to state which versions of php they support... Say SMF bumps its supported version in a minor release, but the modders do not update the package info etc, or its not stated clearly, then folks end up with mods that do not support the same versions of php that the base application does...

Better yet, if memory servers why doesnt the package manager check that and it be required in the package info, if the check doesnt pass then there is a noticed displayed...

Another thought.... Why not have that included in scheduled task... So, if that was included in the package info, and the host upgrades php, then soon as the scheduled task ran, it could show a notice or send an email to the admin on next login etc telling them that they now have mods that do not support their new version of php.... Just sayin... 99% of users are on servers that they have little to no control over which version of the script engine they run...
PM at your own risk, some I answer, if they are interesting, some I ignore.

Aleksi "Lex" Kilpinen

I kinda like that idea, though there are also plenty simple mods that don't really have much version dependencies that I can think of - still at least optionally having something like that built in to the system and encouraging modders to use it, would sound like a good idea.
Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

rcane

Quote from: Aleksi "Lex" Kilpinen on March 01, 2022, 01:06:14 AM
Quote from: rcane on February 28, 2022, 08:34:50 PMseems to point to subs-shoutbox.php
This would also point a modification, there's no shoutbox in a vanilla SMF.

turned it off, but using again for a while.

It was shoutbox, and the error was pointing to a key=>value in the shoutbox settings table.   

The key was "banUpadte" and the value was "0". 

I tried 'banning' a test account which put a time stamp in there--and a time stamp when un-banning, so I'll keep a watch to see if anything hits the log.

I thought it was a typo, but every instance I can find of that array it's called "banUpate".  I would have thought they intended to go with "banUpdate", but even THAT doesn't appear in the files list yet.


rcane

Aside from the shoutbox, I'm see now two errors in Ants Mutant theme.

post.template.php, lines 473 and 489.

line 473
<input type="file" size="60" name="attachment[]" id="attachment1" class="input_file" /> (<a onclick="insertAttachment(', ((empty($context['current_attachments']) ? 0 : count($context['current_attachments'])) + !empty($modSettings['ila_one_based_numbering'])), '); return false;">', sprintf($txt['ila_insert'], ((empty($context['current_attachments']) ? 0 : count($context['current_attachments'])) + !empty($modSettings['ila_one_based_numbering']))),'</a>) (<a href="javascript:void(0);" onclick="cleanFileInput(\'attachment1\');">', $txt['clean_attach'], '</a>)';

line 489
var temp = "', $txt['ila_insert'], '";

The only mod i can think of is post & pm inline attachments which isn't installed anymore. 


I see some differences in Ant's post.template file versus what I have installed.   I think there was an uninstall issue that left some stuff behind.

rcane

Quote from: Tyrsson on March 01, 2022, 01:00:08 AMThat error referrers to trying to access an index for a variable that should be an array but is actually null.
<?php
declare(strict_types=1);
$array null;
if(
$array['some_key']) {
    
// will cause the same error that you are having, tested in php version 7.4.9

Basically somewhere in the code it reads something like the above, there is a check for something that is not the expected type, which would be an array, but instead its null.

My first suggestion would be to check your current version of Php that is running on your server instance, then make sure that your current version of SMF supports that version.


Using PHP 7.4.33.


rcane

Quote from: Tyrsson on March 01, 2022, 01:00:08 AMThat error referrers to trying to access an index for a variable that should be an array but is actually null.
<?php
declare(strict_types=1);
$array null;
if(
$array['some_key']) {
    
// will cause the same error that you are having, tested in php version 7.4.9

Basically somewhere in the code it reads something like the above, there is a check for something that is not the expected type, which would be an array, but instead its null.

My first suggestion would be to check your current version of Php that is running on your server instance, then make sure that your current version of SMF supports that version.


Using PHP 7.4.33 which shouldn't be a problem.

I took the shoutbox out, as well as ohara youtube.  Saw error for that too. 

Don't care about videos, but the shoutbox was very helpful.   Need to find one for 2.0.19.




I'm also seeing errors on Sources/Load.php

lines:  2046, 2047, 2053

Arantor


Advertisement: