SMFHacks.com

SMF Gallery Pro => Support => Topic started by: pete on January 22, 2022, 07:23:14 am

Title: 8: Trying to access array offset on value of type null
Post by: pete on January 22, 2022, 07:23:14 am
Since updating my php to 7.4 I get error messages

 8: Trying to access array offset on value of type null
/smf/Sources/Gallery2.php
Line: 1472

1471:            'password' => $row4['password'],
==>1472:            'private' => $row4['private'],

I'm currently using Gallery Pro Version 8.0.6

Any ideas why?

Thanks

Title: Re: 8: Trying to access array offset on value of type null
Post by: SMFHacks on January 22, 2022, 07:31:37 am
Was fixed in a later version
Find
Code: [Select]
$context['gallery_user_settings'] = array(
'password' => $row4['password'],
'private' => $row4['private'],
);
before it add
Code: [Select]
if (empty($row4['id_member']))
{
$row4['password'] = '';
$row4['private'] = '';
}

Title: Re: 8: Trying to access array offset on value of type null
Post by: pete on January 22, 2022, 08:08:55 am
Thanks. I did that and now getting

8192: implode(): Passing glue string after array is deprecated. Swap the parameters
/smf/Sources/Gallery2.php

==>15016:         $groupsdata = implode($user_info['groups'], ',');
Title: Re: 8: Trying to access array offset on value of type null
Post by: SMFHacks on January 22, 2022, 08:15:01 am
Fixed in new version as well change
$groupsdata = implode($user_info['groups'], ',');
to
$groupsdata = implode(',',$user_info['groups']);
Title: Re: 8: Trying to access array offset on value of type null
Post by: pete on January 22, 2022, 08:18:25 am
That's great. Thanks :)
Title: Re: 8: Trying to access array offset on value of type null
Post by: pete on January 22, 2022, 09:23:01 am
One more, but we're getting there :)

8: Trying to access array offset on value of type null
smf/Sources/Gallery2.php
Line: 1475

==>1475:
            'private' => $row4['private'],

==>1474:            'password' => $row4['password'],

==>1471:            'private' => $row4['private'],

==>1470:            'password' => $row4['password'],

Thanks
Title: Re: 8: Trying to access array offset on value of type null
Post by: pete on January 22, 2022, 09:39:20 am
Sorry, think I've got it. I forgot save changes for your the first instruction on my live site. Test site was fine. I'll keep testing. Many thanks
Pete
Title: Re: 8: Trying to access array offset on value of type null
Post by: pete on January 22, 2022, 02:34:12 pm
Still not quite fixed. New error message


8192: implode(): Passing glue string after array is deprecated. Swap the parameters

/smf/Sources/Gallery2.php
Line: 11080

==>11080:         $groupsdata = implode($user_info['groups'],',');

Is there an easy fix for this one?

Thanks
Title: Re: 8: Trying to access array offset on value of type null
Post by: SMFHacks on January 22, 2022, 02:38:48 pm
Same fix as the one above.
Title: Re: 8: Trying to access array offset on value of type null
Post by: pete on January 22, 2022, 03:00:34 pm
Thanks. Didn't notice there were 4 entries to be updated. Fingers crossed all fixed now.
Title: Re: 8: Trying to access array offset on value of type null
Post by: pete on January 27, 2022, 03:11:34 am
Now getting these

8: Trying to access array offset on value of type null  /smf/Sources/UserGallery2.php
Line: 1701
==>1701:                  'name' => $row1['title']

/smf/Sources/UserGallery2.php
Line: 1697
==>1697:      UserParentLink($row1['ID_PARENT'], $memberID);

/smf/Sources/UserGallery2.php
Line: 211
==>211:               'name' => $row1['real_name'],

/smf/Sources/UserGallery2.php
Line: 198
==>198:         $context['gallery_cat_name'] = $row1['title'];

==>197:         $context['gallery_orderby'] = $row1['orderby'];

==>196:         $context['gallery_sortby'] = $row1['sortby'];

I really appreciate your help.





Title: Re: 8: Trying to access array offset on value of type null
Post by: SMFHacks on January 27, 2022, 09:21:28 am
There is going to be a bunch of these errors in the older version
The new update which can be bought if your license expired $25
https://www.smfhacks.com/index.php?action=license
Title: Re: 8: Trying to access array offset on value of type null
Post by: pete on January 27, 2022, 10:00:53 am
Ok. I've done that. Now on 9.0b. Hopefully all will be sorted now. Thank you
Title: Re: 8: Trying to access array offset on value of type null
Post by: SMFHacks on January 27, 2022, 10:27:28 pm
Thanks yeah should fix any of those issues plus several new features too!
Title: Re: 8: Trying to access array offset on value of type null
Post by: pete on January 29, 2022, 03:40:27 am
I'm still getting these error messages, but as they are related to attachments, they are probably nothing to do with Gallery Pro, more likely the Automatic Rotation and Resize mod. Any idea? Thanks

https://bsac10c11c12.co.uk/smf/index.php?action=dlattach;topic=8074.0;attach=28967;image;ts=15470303442:
Cannot modify header information - headers already sent
File: /smf/Sources/Subs.php
Line: 3411

==>3411:      header('Content-Type: text/' . (isset($_REQUEST['xml']) ? 'xml' : 'html') . '; charset=' . (empty($context['character_set']) ? 'ISO-8859-1' : $context['character_set']));
Title: Re: 8: Trying to access array offset on value of type null
Post by: SMFHacks on January 29, 2022, 11:40:51 am
Not from the Gallery but I would need to see that Subs.php That errors means something is outputted before the headers is sent.
Title: Re: 8: Trying to access array offset on value of type null
Post by: pete on January 29, 2022, 11:47:39 am
Would you mind checking it out for me? If so, how would I send you my Subs.php? Many thanks
Title: Re: 8: Trying to access array offset on value of type null
Post by: SMFHacks on January 29, 2022, 11:53:41 am
Just attach it to the post an an attachment
Title: Re: 8: Trying to access array offset on value of type null
Post by: pete on January 29, 2022, 12:43:40 pm
Hope this works. Thanks for your help
Title: Re: 8: Trying to access array offset on value of type null
Post by: SMFHacks on January 29, 2022, 01:03:21 pm
Unfortunately doesn't give me enough information.
That error points to the line where the template header is loaded. it shouldn't be called though when displaying an attachment.
Title: Re: 8: Trying to access array offset on value of type null
Post by: pete on January 29, 2022, 01:09:46 pm
I appreciate you trying for me. Everything seems to be working fine, and I don't get the error message often, so maybe best to just ignore it.
Title: Re: 8: Trying to access array offset on value of type null
Post by: pete on February 08, 2022, 08:22:16 am
Everything has been running fine since updating to 9.0b, but now I'm getting these errors. Would these have anything to do with settings? I haven't changed anything since the update.

8: Trying to access array offset on value of type null
 fileFile: smf/Sources/UserGallery2.php

 Lines 200,201,202,215,1701,1705

==>200:         $context['gallery_sortby'] = $row1['sortby'];

==>201:         $context['gallery_orderby'] = $row1['orderby'];

==>202:         $context['gallery_cat_name'] = $row1['title'];

==>215:               'name' => $row1['real_name'],

==>1701:      UserParentLink($row1['ID_PARENT'], $memberID);

==>1705:                  'name' => $row1['title']

Thanks
Title: Re: 8: Trying to access array offset on value of type null
Post by: SMFHacks on February 08, 2022, 08:57:36 am
No, that is one I would need to look into.
Title: Re: 8: Trying to access array offset on value of type null
Post by: pete on February 08, 2022, 09:16:41 am
Thanks
Title: Re: 8: Trying to access array offset on value of type null
Post by: SMFHacks on February 08, 2022, 07:41:48 pm
Fixed

9.0.1
+Cleaned up the stats page for SMF 2.1
!Fixed bug with updating topic/post if you using the image editor.
!Fixed some array access variables for new php version in user galleries
!Fixed the increase post count setting on bulk picture uploads.
Title: Re: 8: Trying to access array offset on value of type null
Post by: pete on February 09, 2022, 06:58:18 am
I've updated to 9.0.1 on my test site, now I'm getting the attached message when trying to view a members album
Title: Re: 8: Trying to access array offset on value of type null
Post by: SMFHacks on February 09, 2022, 07:00:43 am
Had one typo copy to your sources folder
Title: Re: 8: Trying to access array offset on value of type null
Post by: pete on February 09, 2022, 07:07:35 am
Thanks. That's sorted it. I'll download the corrected version to put on my live site
Title: Re: 8: Trying to access array offset on value of type null
Post by: SMFHacks on February 09, 2022, 07:56:53 am
Updated main zip
9.0.1a
One hotfix for user galleries.
Title: Re: 8: Trying to access array offset on value of type null
Post by: pete on February 09, 2022, 08:10:30 am
I'm spending far too long trying to find the update zip, I found it earlier, but now can't. Where do I find it?
Title: Re: 8: Trying to access array offset on value of type null
Post by: SMFHacks on February 09, 2022, 08:19:09 am
https://www.smfhacks.com/index.php/topic,10069.msg44413.html#msg44413
Title: Re: 8: Trying to access array offset on value of type null
Post by: pete on February 09, 2022, 08:36:17 am
Thanks
Title: Re: 8: Trying to access array offset on value of type null
Post by: pete on February 15, 2022, 02:43:25 am
I don't know if this error message has anything to do with Gallery Pro, but it does occur sometimes when guests (machines?) open an image. I'm not getting a reply from the snowflake mod help forum. You may be able to help?

https://bsac10c11c12.co.uk/smf/index.php?PHPSESSID=b9f061190472c83f5bd0a680f65e5bb9&action=dlattach;topic=11051.0;attach=32078;image;ts=1553017207

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

/smf/Sources/snowflakesMobileDetect.php
Line: 1065

==>1065:                 if (is_array($matchType['matches'])) {

Thanks
Title: Re: 8: Trying to access array offset on value of type null
Post by: SMFHacks on February 15, 2022, 07:31:44 am
No related to the galley but you can add before that line this code
Code: [Select]
if (empty($matchType['matches']))
$matchType['matches'] = array();
Title: Re: 8: Trying to access array offset on value of type null
Post by: pete on February 15, 2022, 08:27:48 am
Thank you  :)
Title: Re: 8: Trying to access array offset on value of type null
Post by: pete on March 25, 2022, 05:27:11 am
I'm still getting the odd error message relating to Gallery2 that you might be able to help me with.

/smf/index.php?pretty;action=gallery&sa=search2
8: Undefined index: orderby
/public_html/smf/Sources/Gallery2.php
Line: 5464

==>5464:            $orderby = $_REQUEST['orderby'];

/smf/index.php?pretty;action=gallery&sa=search2
8: Undefined index: sortby
/smf/Sources/Gallery2.php
Line: 5463

==>5463:            $sortby = $_REQUEST['sortby'];

/smf/index.php?pretty;action=gallery&sa=search2
8: Undefined index: gallerytype
/smf/Sources/Gallery2.php
Line: 5461

==>5461:            $gallerytype = $_REQUEST['gallerytype'];

/smf/index.php?pretty;action=gallery&sa=search2
8: Undefined index: mediatype
/smf/Sources/Gallery2.php
Line: 5460

==>5460:            $mediatype = $_REQUEST['mediatype'];

Many thanks
Title: Re: 8: Trying to access array offset on value of type null
Post by: SMFHacks on March 25, 2022, 10:24:38 pm
That should be fixed I think already.
If not here is the gallery2.php file to your sources folder.
Title: Re: 8: Trying to access array offset on value of type null
Post by: pete on March 26, 2022, 02:10:07 pm
Thanks. I have updated that file now.

Could the same apply to this error in the UserGallery.php?

/smf/index.php?pretty;action=gallery&su=user;u=868
8: Trying to access array offset on value of type null
/smf/Sources/UserGallery2.php
Line: 477

==>477:            $context['usergallery_name'] = $row['real_name'];
Title: Re: 8: Trying to access array offset on value of type null
Post by: SMFHacks on March 26, 2022, 07:47:54 pm
Copy to sources folder.
Title: Re: 8: Trying to access array offset on value of type null
Post by: pete on March 27, 2022, 05:51:08 am
Thank you :)