Übersicht über das Problem
Wenn Sie ein Menü erstellen und es unter DesignMenüs einem Ort zuweisen, wird beim Aktualisieren der Seite das Kontrollkästchen für den Ort abgewählt. Das Menü wird jedoch weiterhin korrekt im Frontend angezeigt.
Dieses Problem tritt auf, wenn Term-IDs nicht mit den Term-Taxonomie-IDs übereinstimmen, was auf Websites passieren kann, die WordPress seit Version 4.1 oder älter ausführen, wie hier (wird in einem neuen Tab geöffnet) erklärt.
Problemumgehung
Dieses Problem ist in WPML 4.6.4 behoben. Ein Update behebt dies auf Ihrer Website, daher benötigen Sie diese Problemumgehung nur, wenn Sie noch nicht aktualisieren können.
Bitte erstellen Sie ein vollständiges Backup Ihrer Website, bevor Sie fortfahren.
- Öffnen Sie …/sitepress-multilingual-cms/inc/taxonomy-term-translation/wpml-term-translation.class.php.
- Suchen Sie nach Zeile 118.
- Ändern Sie:
in:PHP
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']; } } }
PHPprivate 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']); } } }