• Resolved Philipp Thom

    (@philipp-thom)


    Dear Developer,

    I found a bug that came with your recent version of this plugin.

    In the file facebook-for-woocommerce/includes/Products.php on line 584

    There error belongs to this while loop, which runs endless if the parent is empty!

    while ( $parent_category->parent !== 0 ) {
       $parent_category = get_term( $parent_category->parent, 'product_cat' );
       $level ++;
     }

    Wrap it in a check if parent is set to avoid endless looping and server out of memory!!
    Change it to:

    if(isset($parent_category->parent)) {
       while ( $parent_category->parent !== 0 ) {
       $parent_category = get_term( $parent_category->parent, 'product_cat' );
       $level ++;
     }
    }
    • This topic was modified 4 years, 2 months ago by Philipp Thom.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Endless while loop’ is closed to new replies.