• Resolved Martin Blumenfeld

    (@monkeypress)


    A clients import was failing so I dug into their code to see what’s up. I think I found an query bug in the /src/ACFService.php file. Check out line 293. You’re preparing a query to insert groups of 3 term_relationships values. Your implode statement however will output the (%d, %d, %d) string three times even if there are only three values. Should count( $values ) be divided by three in this case?

    if ( false === $wpdb->query( $wpdb->prepare( “INSERT INTO {$wpdb->term_relationships} (object_id, term_taxonomy_id, term_order) VALUES ” . implode( ‘, ‘, array_fill( 0, count( $values ), “(%d, %d, %d)” ) ) . ” ON DUPLICATE KEY UPDATE term_order = VALUES(term_order)”, …$values ) ) ) {

Viewing 1 replies (of 1 total)
  • Plugin Author Trey

    (@ix3)

    Hey @monkeypress,

    Apologies for the delay, I missed this post. You were right, this line was problematic, and we fixed it in the latest update. Thank you for bringing it to our attention!

Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.