• Hi!

    We noticed an issue with how the code handles breadcrumbs when viewing a translated site, and the translation doesn’t yet contain all the required relationships.

    For example, we have a product cpt on our site that has a custom taxonomy for product_type.

    When translating manually through WPML, we receive the following error on page load:

    Catchable fatal error: Object of class WP_Error could not be converted to string in wp-includes/formatting.php on line 2896

    If I remove the breadcrumb navxt code from the theme, it works fine.

    I think the issue is that it’s looking for a translation of the product type category but as this doesn’t exist yet, WordPress is returning an Error object and Breadcrumb NavXT isn’t handling the fact an error is returned correctly.

    https://ww.wp.xz.cn/plugins/breadcrumb-navxt/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author John Havlik

    (@mtekk)

    Interesting, I will have to try reproducing this on my testbed. Note that in many cases, if a function is returning a WP_Error on Breadcrumb NavXT will result in a situation that Breadcrumb NavXT can not be expected to handle (hence an error or warning may/should propagate up). I will reserve judgment on this one until I can reproduce it.

    Thread Starter bigspring

    (@bigspring)

    Sure, that’s understood. The issue for me is that a content issue produces a hard PHP error which stops the site from functioning. In my mind it would be better to have a failed breadcrumb than a broken site.

    Thread Starter bigspring

    (@bigspring)

    Did you manage to recreate this issue? I’m wondering if you can recommend anything from the theme point of view to catch the error and not display the breadcrumb if this error is found.

    Plugin Author John Havlik

    (@mtekk)

    Sorry, I haven’t had a chance yet (I have school work that’s eaten up most of my free time). I will try to look at it this upcoming weekend, but I can’t make any promises at the moment.

    Thread Starter bigspring

    (@bigspring)

    No problems!

    I’m happy to take a look myself and contribute if I can. Can you steer me towards where I should be looking? The error doesn’t really suggest where the problem could be in the NavXT code.

    Plugin Author John Havlik

    (@mtekk)

    I would check the class.bcn_breadcrumb_trail.php file, look at the post_terms(), term_parents(), and do_post() member functions of bcn_breadcrumb_trail. They are likely the three that may be getting the WP_Error. I have this on my todo list, but it may still be a while before I get to it.

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Issues with WPML’ is closed to new replies.