- 상태
- 해결됨
- 보고된 제품
- WPML Multilingual CMS 4.6.3
- 해결된 버전
- WPML 4.6.4
- 주제 태그
- Bug
문제 개요
외모 → 메뉴에서 메뉴를 생성하고 위치에 할당한 후 페이지를 새로 고침하면 위치 확인란의 선택이 해제됩니다. 하지만 프런트엔드에서는 메뉴가 여전히 올바르게 표시됩니다.
이 문제는 용어 ID가 용어 택소노미 ID와 같지 않을 때 발생하며, 여기에 설명된 대로 버전 4.1 이하부터 WordPress를 실행 중인 사이트에서 발생할 수 있습니다.
임시 해결 방법
진행하기 전에 반드시 사이트의 전체 백업을 수행하세요.
- …/sitepress-multilingual-cms/inc/taxonomy-term-translation/wpml-term-translation.class.php 파일을 여세요.
- 118번 줄을 찾으세요.
- 다음을:
private function maybe_warm_term_id_cache() { if ( ! isset( $this->ttids ) || ! isset( $this->term_ids ) ) { $data = $this->wpdb->get_results( " SELECT wpml_translations.element_id, tax.term_id, tax.taxonomy " . $this->get_element_join() . " JOIN {$this->wpdb->terms} terms ON terms.term_id = tax.term_id WHERE tax.term_id != tax.term_taxonomy_id", ARRAY_A ); $this->term_ids = array(); $this->ttids = array(); foreach ( $data as $row ) { $this->ttids[ $row['term_id'] ] = isset( $this->ttids[ $row['term_id'] ] ) ? $this->ttids[ $row['term_id'] ] : array(); $this->ttids[ $row['term_id'] ][ $row['taxonomy'] ] = $row['element_id']; $this->term_ids[ $row['element_id'] ] = $row['term_id']; } } }다음으로 변경하세요:private function maybe_warm_term_id_cache() { if ( ! isset( $this->ttids ) || ! isset( $this->term_ids ) ) { $data = $this->wpdb->get_results( " SELECT wpml_translations.element_id, tax.term_id, tax.taxonomy " . $this->get_element_join() . " JOIN {$this->wpdb->terms} terms ON terms.term_id = tax.term_id WHERE tax.term_id != tax.term_taxonomy_id", ARRAY_A ); $this->term_ids = array(); $this->ttids = array(); foreach ( $data as $row ) { $this->ttids[ $row['term_id'] ] = isset( $this->ttids[ $row['term_id'] ] ) ? absint($this->ttids[ $row['term_id'] ]) : array(); $this->ttids[ $row['term_id'] ][ $row['taxonomy'] ] = absint($row['element_id']); $this->term_ids[ $row['element_id'] ] = absint($row['term_id']); } } }