Closed bobbingwide closed 3 years ago
There was also a similar message when a taxonomy being cloned does not exist in the slave.
The fix for the first problem is to find the term using the slug
rather than the name
.
The fix for the second problem is to not continue processing taxonomy terms when the taxonomy is not known to the slave.
Changing to match on slug
works some of the time, but not for a taxonomy term with a name of &
.
Try changing it back to match on lower case name
.
We can't do that since the name
fields in the list of terms are mixed case.
A pragmatic solution, other than to attempt to create the term and then be told there's a problem, is to check if the term_id
and slug
are the same. If they are then attempt to match on the term name
else match on the slug
.
IMO WordPress’s logic is flawed. Why tell the calling routine that creating a term failed when there’s a problem with the case? WordPress is responsible for creating the slug, so it should just say, ‘here’s the term you were looking for’.
oik-clone v2.0.0 is now released. Closing this issue.
While running
oikwp class-oik-clone-pull.php jetpack.wp.a2z block url=blocks.wp.a2z
to pull blocks from jetpack.wp.a2z to blocks.wp.a2z there was aFatal error: Uncaught Error: Cannot use object of type WP_Error as array in C:\apache\htdocs\wordpress\wp-content\plugins\oik-clone\admin\class-oik-clone-taxonomies.php:462
A WP_Error was returned from the wp_insert_term() call in create_term() for the taxonomy term "contact" where the source term id was 139 and the existing term was 132.
The existing term was "Contact" - which has a different case from the term we were trying to create.