WPML
Estado
Resuelto
Notificado para
WPML Multilingual CMS 4.6.3
Resuelto en
WPML 4.6.4
Etiquetas de temática
Bug

Resumen del problema

Al crear un menú y asignarlo a una ubicación en AparienciaMenú, al actualizar la página se desmarca la casilla de ubicación. Sin embargo, el menú se sigue mostrando correctamente en el front-end.

Este problema ocurre cuando los ID de los términos no son iguales a los ID de la taxonomía del término, lo que puede suceder en sitios que ejecutan WordPress desde la versión 4.1 o anterior, como se explica aquí.

Solución alternativa

Por favor, asegúrese de hacer una copia de seguridad completa de su sitio antes de continuar.


  1. Abra …/sitepress-multilingual-cms/inc/taxonomy-term-translation/wpml-term-translation.class.php.

  2. Busque la línea 118.

  3. Cambie:
    	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'];
    			}
    		}
    	}
    Por:
    	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']);
    			}
    		}
    	}

Todos los problemas conocidos →