[wp-trac] [WordPress Trac] #38508: wp_insert_term and [term_taxonomy_id] => 0 )
WordPress Trac
noreply at wordpress.org
Fri Oct 28 16:47:42 UTC 2016
#38508: wp_insert_term and [term_taxonomy_id] => 0 )
-------------------------------+------------------------------
Reporter: staticweb | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Taxonomy | Version: 4.6.1
Severity: normal | Resolution:
Keywords: reporter-feedback | Focuses:
-------------------------------+------------------------------
Comment (by staticweb):
@boonebgorges:
> What tool are you using to import osCommerce items into WooCommerce?
It's possible that the tool is doing direct database imports.
I've done a sql dump with phpmyadmin and make sql selects with a PHP
Script.
I found the reason for the error.
The osCommerce data are in latin1. I've done the sql dump with utf-8 and
the local osCommerce database is in utf-8 also.
4 category descriptions have a special content with line break after
german umlaut ä. I deleted the line breaks and it works.
The deleted HexCode ist d0a0d0a0 .
In lines 2366/2367 of taxonomy.php the insert not working with the special
characters.
{{{#!php
$wpdb->insert( $wpdb->term_taxonomy, compact( 'term_id', 'taxonomy',
'description', 'parent') + array( 'count' => 0 ) );
$tt_id = (int) $wpdb->insert_id;
}}}
Description content must better sanitize for insert with success.
> term_taxonomy_id should never equal 0. It's an autoincrement field.
The insert don't work!
--
Ticket URL: <https://core.trac.wordpress.org/ticket/38508#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list