Opened 15 years ago
Closed 15 years ago
#11962 closed defect (bug) (fixed)
The function global_terms() is bugged.
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 3.0 | Priority: | normal |
Severity: | normal | Version: | 2.9.1 |
Component: | Taxonomy | Keywords: | needs-patch |
Focuses: | multisite | Cc: |
Description
The function incriminated :
http://core.trac.wordpress.org/browser/trunk/wp-includes/ms-functions.php#L1790
I have a custom taxonomy (but i think the problem as the same with categories/tags), i edit a term with the ID 199.
The update_term fonction of WordPress work normally, but the mu fonction will return a fake ID in filter.
I edit the term_id 199, the function return 8, and the function update the database with a incorrect ID on the term_taxonomy table.
In fact, this function update the term ID of term_taxonomy table with the ID of the global database... Strange !
I do not propose a patch because I do not know if this table will be preserved in the future.
In the meantime, to correct the problem, it is enough to deactivate the filter with the function remove_filter() in a mu-plugins
Change History (10)
#3
@
15 years ago
Just one precision, the bug is caused by a core function of WordPress and it are not related to a custom taxonomy.
In fact, when you import a WordPress blog into WordPress Mu (without the XML import/export, directly by coping tables), you import somes categories and some tags on local blog. But theses local terms aren't added on the global terms...
And when you want edit a term of this freshly imported blog, the edition will corrupted...
I am sure that there is something to improve in this global table... (update schema ? build specific API)
#5
@
15 years ago
One upgrade to multisite, the sitecategories table needs to be populated from the terms table.
#7
@
15 years ago
If I were "importing" by copying in tables, I would massage the terms tables using the same method I used to import the blog: MySQL.
The issue you are having is that your SQL imported blog has term slug some-thing on term id 123. In the existing MU install the term some-thing already exists as id 456. So, the WordPress function is giving you back the correct id for that term in this MU install.
In MU, term slugs cannot be edited once they are created because the slug is shared across the install.
If you want to change the slug of a term from a plugin, create a new term with the slug you want, add the term to the object(s) & remove the original term from the object(s).