نظرة عامة على المشكلة
عند إنشاء قائمة وتعيينها إلى موقع في المظهرالقوائم، يؤدي تحديث الصفحة إلى إلغاء تحديد مربع اختيار الموقع. ومع ذلك، لا تزال القائمة تُعرض بشكل صحيح في الواجهة الأمامية.
تحدث هذه المشكلة عندما تكون معرفات المصطلحات غير مساوية لمعرفات تصنيف المصطلحات، وهو ما يمكن أن يحدث في المواقع التي تعمل بنظام WordPress منذ الإصدار 4.1 أو أقدم كما هو موضح هنا (يفتح في علامة تبويب جديدة).
حل بديل مؤقت
تم إصلاح هذه المشكلة في WPML 4.6.4. يحل التحديث المشكلة على موقعك، لذا لا تحتاج إلى هذا الحل البديل المؤقت إلا إذا لم تتمكن من التحديث بعد.
يُرجى التأكد من إنشاء نسخة احتياطية كاملة لموقعك قبل المتابعة.
- افتح …/sitepress-multilingual-cms/inc/taxonomy-term-translation/wpml-term-translation.class.php.
- ابحث عن السطر 118.
- غيّر:
إلى: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']); } } }