• Resolved masherbrum

    (@masherbrum)


    Hi,

    Thank you for this plugin I have been using for a few years.
    I have a blog section on my e-commerce website. Thing is, since the last update my blog posts categories disappeared, and trying to reassign them would have no effect. My posts all fall under “Uncategorized”.
    Also, and more important, I can’t add a new post or duplicate one.

    This conflicts disappear when deactivating the plugin.
    My WP installation and plugins are all up-to-date.

    The debug.log says : PHP Recoverable fatal error: Object of class WP_Term could not be converted to string in /wp-includes/taxonomy.php on line 2334

    The concerned line is this one :
    $in_delete_tt_ids = "'" . implode( "', '", $delete_tt_ids ) . "'";

    In the following section :

    /**
    		 * Fires immediately after an object-term relationship is added.
    		 *
    		 * @since 2.9.0
    		 * @since 4.7.0 Added the <code>$taxonomy</code> parameter.
    		 *
    		 * @param int    $object_id Object ID.
    		 * @param int    $tt_id     Term taxonomy ID.
    		 * @param string $taxonomy  Taxonomy slug.
    		 */
    		do_action( 'added_term_relationship', $object_id, $tt_id, $taxonomy );
    		$new_tt_ids[] = $tt_id;
    	}
    
    	if ( $new_tt_ids )
    		wp_update_term_count( $new_tt_ids, $taxonomy );
    
    	if ( ! $append ) {
    		$delete_tt_ids = array_diff( $old_tt_ids, $tt_ids );
    
    		if ( $delete_tt_ids ) {
    			$in_delete_tt_ids = "'" . implode( "', '", $delete_tt_ids ) . "'";
    			$delete_term_ids = $wpdb->get_col( $wpdb->prepare( "SELECT tt.term_id FROM $wpdb->term_taxonomy AS tt WHERE tt.taxonomy = %s AND tt.term_taxonomy_id IN ($in_delete_tt_ids)", $taxonomy ) );
    			$delete_term_ids = array_map( 'intval', $delete_term_ids );
    
    			$remove = wp_remove_object_terms( $object_id, $delete_term_ids, $taxonomy );
    			if ( is_wp_error( $remove ) ) {
    				return $remove;
    			}
    		}
    	}

    When trying to duplicate a post it gives me an error on line 2331, same file.

    Would you have an idea on how to solve this problem ?
    Thank you for your help.

    • This topic was modified 6 years ago by masherbrum.
    • This topic was modified 6 years ago by masherbrum.
Viewing 8 replies - 1 through 8 (of 8 total)
  • Square Eye

    (@squareeye)

    Hi, we’re getting this problem too. With Yoast enabled, we get this error on the Add Post page:

    Catchable fatal error: Object of class WP_Term could not be converted to string in /nas/content/staging/xxiv/wp-includes/taxonomy.php on line 2334

    Disable Yoast and it works again. Grateful for any advice in getting round it.

    Sa?a

    (@stodorovic)

    There is similar error related to Divi, WPML and Yoast SEO plugin. It’s fixed in WPML 4.2.1.
    I’m not sure is it same. Please send more details about theme/plugins?

    Square Eye

    (@squareeye)

    Thank you Sa?a! We didn’t have Divi on this site, but do have WPML, and upgrading it from 4.2.0 to 4.2.1 did the trick. Much appreciated.

    Pcosta88

    (@pcosta88)

    Hi @masherbrum,

    Can you please provide a link to your site as we want to take a closer look at the issue.

    Thread Starter masherbrum

    (@masherbrum)

    Hi @pcosta88
    Sure : masherbrum.fr
    Using Flatsome theme + WPML 4.2.0
    Update 4.2.1 not showing but I think I could install it manually, as it seems to resolve the problem according to the people that faced the same dysfunction.
    Best regards,

    Pcosta88

    (@pcosta88)

    Hi,

    Thanks! We do see you have an older version of WPML (v4.2), if you update to v4.2.1 does the issue resolve?

    Plugin Support amboutwe

    (@amboutwe)

    This thread has been marked as resolved due to lack of activity.

    You’re always welcome to re-open this topic. Please read this post before opening a new request.

    Thanks for understanding!

    Thread Starter masherbrum

    (@masherbrum)

    Hi,
    I updated to WPML Version 4.5.0, and post categories still disappear as soon as I activate Yoast SEO (v10.1.3). Also when activated, still can’t add new post.
    Things get back to normal when turning Yoast off.

    Would you have any new idea on how to solve this problem ?
    Thank you for your help.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Can’t add new post when Yoast SEO is activated’ is closed to new replies.