WPML
สถานะ
รอผู้พัฒนา
รายงานสำหรับ
WPML Multilingual for BuddyPress and BuddyBoss 1.7.0
ปลั๊กอิน/ธีมที่เกี่ยวข้อง
BuddyPress
แท็กหัวข้อ
Compatibility

ภาพรวมของปัญหา

การอัปเดตล่าสุดของ BuddyPress 12.4.1 ทำให้เกิดปัญหาความเข้ากันได้กับ WPML โดยเฉพาะเกี่ยวกับการจัดการคำอธิบายกลุ่ม การเปลี่ยนแปลงนี้ทำให้เกิดข้อผิดพลาดร้ายแรงเมื่อมีการเรียกใช้ฟิลเตอร์ 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 ) );
    	}

ปัญหาที่ทราบแล้วทั้งหมด →