Skip to:
Content
Pages
Categories
Search
Top
Bottom

Critical errors after updating to PHP 8.0


  • CGC studio
    Participant

    @cgc-studio

    WordPress v 6.1.1
    BuddyPress v 11.0.0

    Theme Onecommunity (latest version 3.7.8) (https://themeforest.net/item/onecommunity-buddypress-theme/3713046?gclid=CjwKCAiAqt-dBhBcEiwATw-ggL19B1O2bH4PjCwmpFyse_KZ7o4KEGnurStZcFrqDBd1d-3rDApwZxoC22cQAvD_BwE)
    My frontend test Site: https://staging-rezodenthodenthcom-staging.kinsta.cloud/

    Hi there!

    1/ After updating my hosted site from php 7.4 to 8.0 (Kinsta hosting), buddypress causes the following critical syntax error !

    2023/01/06 13:48:41 [error] 43493#43493: *668 FastCGI sent in stderr: “PHP message: PHP Parse error: syntax error, unexpected token “;”, expecting “)” in /www/rezodenthodenthcom_528 /public/wp-content/themes/onecommunity/buddypress/groups/single/group-header.php on line 29

    The site (front and backend) is still visible but the groups are not displayed anymore in groups single page
    Could you please be kind enough to help solving this first problem?

    2/ I usually use a child theme with two small custom codes that worked fine in php 7.4 but with php 8.0, I have a new FTAL error. So it appears that this function somehow is not working correctly with the child theme enabled: call_user_func_array()
    From that stack trace in the Fatal error, it is referencing BuddyPress with it:
    #2 /www/rezodenthodenthcom_528/public/wp-content/plugins/buddypress/bp-core/bp-core-dependency.php(407): do_action(‘bp_widgets_init’)

    As far as I know, our custom codes were very limited in 2 templates :

    Template 1: group-sidebar.php  :
    WE CHANGED THIS CODE:
    $group_id = bp_get_current_group_id();
    echo do_shortcode( ‘[rtmedia_gallery context=”group” per_page=”6″ context_id=”5″ context_id=”‘ . $group_id . ‘”]’ );
    BY THAT ONE:
    if ( bp_group_is_visible() ) :
    $group_id = bp_get_current_group_id();
    echo do_shortcode( ‘[rtmedia_gallery context=”group” per_page=”6″ context_id=”5″ context_id=”‘ . $group_id . ‘”]’ );
    endif;

    Template 2: group-sidebar.php (for customiszation image ads in widget column) with this code:
    <div class=”bp-sidebar-details”>
    <div class=”bp-sidebar-details-category first”><?php _e(‘Advertisement’, ‘onecommunity’); ?></div>
    <div class=”col-1-ads”>
    [widget id=”media_gallery-3″]
    </div>

    I don’t understand what could interfere in php 8.0 environment!
    What do you think about it? and could you help me to solve this second issue?

    Thank you for your appreciated help ; )

    C. GARCIA

Viewing 2 replies - 1 through 2 (of 2 total)

  • wackao
    Participant

    @wackao

    1. This issue seems to be coming from the Groups template in the theme. Contact theme author on this.
    2. The second issue is coming fomr a hook where widgets are initialised. So this could again be coming from the outdated theme.
    I am not sure about the code
    <div class=”col-1-ads”>
    <?php. echo do_shortcode(‘[widget id=”media_gallery-3″]’); ?>
    </div>


    CGC studio
    Participant

    @cgc-studio

    Thank you for your prompt answer
    I’ll going to ask theme’s author as adviced.
    CGC

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
Skip to toolbar