WPML

문제 개요

YITH Affiliate, YITH Giftcards, WCFM 플러그인 및 기타 일부 플러그인에서 이메일을 보낼 때 다음과 같은 오류가 발생할 수 있습니다:

PHP Fatal error:  Uncaught Error: Call to a member function get_id() on array in /public_html/wp-content/plugins/woocommerce-multilingual/inc/class-wcml-emails.php:395

임시 해결 방법

이 문제는 WooCommerce Multilingual 4.9.0-b1에서 해결되었습니다. 업데이트하면 사이트에서 문제가 해결되므로, 아직 업데이트할 수 없는 경우에만 이 임시 해결 방법이 필요합니다.

개발팀에서 이 문제를 해결하기 위해 작업 중입니다.
임시 해결 방법으로, 사이트를 전체 백업했는지 확인한 후에만 wp-content/plugins/woocommerce-multilingual/inc/class-wcml-emails.php로 이동하여 코드를:

public function get_email_translated_string( $key,
		$object, $language)
	{

	$context = 'admin_texts_woocommerce_' . $object->id . '_settings';
	$name    = '[woocommerce_' . $object->id . '_settings]' . $key;

	return $this->wcml_get_translated_email_string( $context, $name, $object->object->get_id(), $language );

에서 다음 코드로 변경하세요:

public function get_email_translated_string( $key, $object, $language ) {
    $context = 'admin_texts_woocommerce_' . $object->id . '_settings';
    $name = '[woocommerce_' . $object->id . '_settings]' . $key;

    $order_id = false;

    if ( method_exists( $object->object, 'get_id' ) ) {
        $order_id = $object->object->get_id();
    }

    if ( is_array( $object->object ) && isset( $object->object['ID'] ) ) {
        $order_id = $object->object['ID'];
    }

    return $this->wcml_get_translated_email_string( $context, $name, $order_id, $language );
}

모든 알려진 문제

여전히 이 문제가 발생합니까?

업데이트해도 문제가 해결되지 않으면 지원 문의를 하세요. 함께 살펴보겠습니다.