wxr import inserts tags with numbers instead of names
|Reported by:||tellyworth||Owned by:|
The wp importer incorrectly inserts tags with the term ID number in place of its name. The first post with that tag works fine, but subsequent posts get bogus numeric tags instead.
It seems to be a simple type issue, numeric string vs int. The enclosed patch fixes it in the importer, but the same issue might affect other code also. Perhaps the fix belongs at a lower level, in wp_set_object_terms() or is_term() (I think the is_int() check in is_term() is the root cause).
Reproduced in unit testing:
There was 1 failure: 1) test_all_posts(TestImportWP) Failed asserting that two strings are equal. expected string <Tag A> difference <xx???> got string <11> /home/zem/projects/wordpress/wordpress-tests/wp-testcase/test_import_wp.php:82 /home/zem/projects/wordpress/wordpress-tests/wp-testlib/base.php:330 /home/zem/projects/wordpress/wordpress-tests/wp-test.php:91