EzPortal - Portal Software for Forums

EzPortal Forums => Support => Topic started by: Paul_123 on April 10, 2021, 08:15:24 pm

Title: Error when guest tries to access a forum that does not have permission
Post by: Paul_123 on April 10, 2021, 08:15:24 pm
Just upgraded to 5.0.1 and using php7.4

When a user tries to go to a topic that they do not have permission to see, there is an error thrown.

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

The error is in Sources/Subs.php, and the line that creates the error is marked in the code below.  (It is line 3988 for me)

Code: [Select]
        // All the buttons we can possible want and then some, try pulling the final list of button$
        if (($menu_buttons = cache_get_data('menu_buttons-' . implode('_', $user_info['groups']) . $
        {
                $buttons = array(
                        'home' => array(
                                'title' => '<img align="absMiddle" src="'. $settings['images_url'].$
                                'href' => $scripturl,
                                'show' => true,
                                'sub_buttons' => array(
                                ),
                                'is_last' => $context['right_to_left'],
                        ),

                // [Forum] button
                        'forum' => array(
                                'title' => $txt['ezp_forum_tab'],
                                'href' => $scripturl . '?action=forum',
                                'show' => ($ezpSettings['ezp_portal_enable'] == 1) ? 1 : 0,    <---Error on this line
                                'icon' => '',
                        ),
'help' => array(
                                'title' => '<img align="absMiddle" src="'. $settings['images_url'].$
                                'href' => $scripturl . '?action=help',
                                'show' => true,
                                'sub_buttons' => array(
                                ),
                        ),

Title: Re: Error when guest tries to access a forum that does not have permission
Post by: EzPortal on April 10, 2021, 10:26:34 pm
Change that line to
Code: [Select]
'show' => !empty($ezpSettings['ezp_portal_enable']),
Title: Re: Error when guest tries to access a forum that does not have permission
Post by: Paul_123 on April 11, 2021, 09:11:45 am
That took care of it, thx.
Title: Re: Error when guest tries to access a forum that does not have permission
Post by: EzPortal on April 11, 2021, 09:30:39 am
Glad to help