- ステータス
- 開発者からの返答待ち
- 報告対象
- WPML Multilingual for BuddyPress and BuddyBoss 1.7.0
- 関連するプラグイン/テーマ
- BuddyPress
- トピックタグ
- Compatibility
問題の概要
最近のBuddyPress 12.4.1へのアップデートにより、WPMLとの互換性の問題(特にグループの説明の処理に関する問題)が発生しました。この変更により、以前は想定されていた必要な第2引数が欠落するようになったため、BuddyPressのフィルターbp_get_group_description_excerptが呼び出された際に致命的なエラーが発生します。
[06-May-2024 15:51:02 UTC] PHP Fatal error: Uncaught ArgumentCountError: Too few arguments to function WPML\\BuddyPress\\Groups::translateExcerpt(), 1 passed in ..../wp-includes/class-wp-hook.php on line 324 and exactly 2 expected in .../wp-content/plugins/buddypress-multilingual/includes/class.groups.php:84
この問題はBuddyPressチームにすでに報告されています。
回避策
続行する前に、必ずサイトの完全なバックアップを取得してください。
- …/wp-content/plugins/buddypress-multilingual/includes/class.groups.phpファイルを開きます。
- 84行目を探します。
- 次のコードを:
public function translateExcerpt( $excerpt, $group ) { $getTranslation = $this->translate( 'description' ); return bp_create_excerpt( $getTranslation( $excerpt, $group ), strlen( $excerpt ) ); } - 以下のように置き換えます:
public function translateExcerpt( $excerpt, $group = null ) { if( is_null($group ) ){ return $excerpt; } $getTranslation = $this->translate( 'description' ); return bp_create_excerpt( $getTranslation( $excerpt, $group ), strlen( $excerpt ) ); }