• Resolved Adrian

    (@adrian2k7)


    Hello,

    There is a check for the product id in class-field-groups.php line 306.

    But as typical in PHP/ WordPress the ID can be a “valid” string as well..

    –> if it isn’t a int the logic will go on an may throw an error later, i.e.

    PHP Fatal error: Uncaught Error: Call to a member function get_id() on string in /…/wp-content/plugins/advanced-product-fields-for-woocommerce/includes/classes/class-field-groups.php:310

    Thanks Adrian

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Maarten

    (@maartenbelmans)

    Hi @adrian2k7

    I understand your point, it might be better to reverse the check (for object instead of int). That said, this function is used internally and we only pass a WC_Product or product ID (which always an int). But it can’t hurt to be complete!

    Thread Starter Adrian

    (@adrian2k7)

    @maartenbelmans

    Thank you, it is also triggered externally

    In \SW_WAPF\Includes\Controllers\Product_Controller::validate_cart_data
    -> Through WooCommerce filter: woocommerce_add_to_cart_validation

    Which might be triggered from other plugins ??

    Plugin Author Maarten

    (@maartenbelmans)

    Good point again! I added it to the to-do list!

    Plugin Author Maarten

    (@maartenbelmans)

    Hi @adrian2k7

    FYI, this is now fixed in the new release (1.5.9).

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Possible exception in class-field-groups.php’ is closed to new replies.