• benlvt

    (@benlvt)


    Hello,

    I have the following error when I switch from PHP 7.4 to PHP 8.1 :

    PHP Fatal error:  Uncaught TypeError: Cannot access offset of type string on string in /wp-content/plugins/buddypress-global-search/includes/search-types/class.BBoss_Global_Search_Type.php:105

    I fixed it by changing the line 105 in buddypress-global-search/includes/search-types/class.BBoss_Global_Search_Type.php

    return isset( $this->search_results['items'][$itemid] ) ? @$this->search_results['items'][$itemid]['html'] : '';
    

    by

    return !empty( $this->search_results['items'][$itemid] ) ? @$this->search_results['items'][$itemid]['html'] : '';
    

    Maybe it’s not the best solution, please update the module with the correct fix.

    • This topic was modified 12 months ago by benlvt.
  • The topic ‘PHP 8 compatibility’ is closed to new replies.