• Resolved datverse

    (@datverse)


    Hi,

    I use:
    PHP 8.0.x
    WordPress 5.9.1
    WooCommerce 6.2

    I got a “Fatal error: Uncaught TypeError” on edit a product:

    Fatal error: Uncaught TypeError: sizeof(): Argument #1 ($value) must be of type Countable|array, string given in /home/domain.com/public_html/wp-content/plugins/product-specifications/inc/admin/views/product-load-table.php:18 
    
    Stack trace: 
    
    #0 /home/domain.com/public_html/wp-content/plugins/product-specifications/inc/admin/class-admin.php(64): include() 
    
    #1 /home/domain.com/public_html/wp-content/plugins/product-specifications/inc/admin/views/products-specs-table.php(32): DWSpecificationsTable\Admin\Admin::get_template('views/product-l...', Array) #2 /home/domain.com/public_html/wp-content/plugins/product-specifications/inc/admin/class-admin.php(64): include('/home/domain.com...') 
    
    #3 /home/domain.com/public_html/wp-content/plugins/product-specifications/inc/admin/class-specification-tables.php(161): DWSpecificationsTable\Admin\Admin::get_template('views/products-...', Array) 
    
    #4 /home/domain.com/public_html/wp-admin/includes/template.php(1395): DWSpecificationsTable\Admin\Specification_Tables::content_product_specs(Object(WP_Post), Array) 
    
    #5 /home/domain.com/public_html/wp-admin/edit-form-advanced.php(688): do_meta_boxes(Object(WP_Screen), 'normal', Object(WP_Post)) 
    
    #6 /home/domain.com/public_html/wp-admin/post.php(206): require('/home/domain.com...') 
    
    #7 {main} thrown in /home/domain.com/public_html/wp-content/plugins/product-specifications/inc/admin/views/product-load-table.php on line 18
    
    There has been a critical error on this website. Please check your site admin email inbox for instructions.

    Reproduce error:
    – Create a Specification Table (With Group, Attributes): “X” table
    – Create a Product “P” Product”
    – Choice Specification Table: “X” Table
    – Delete “X” Table
    – Edit “P” Product
    => Got error on the edit product admin

    => Hot fix:

    On: /wp-content/plugins/product-specifications/inc/admin/views/product-load-table.php:13

    Change: => $groups = empty(get_post_meta($table_id, ‘_groups’, true))? [] : get_post_meta($table_id, ‘_groups’, true);

    Please check.
    Thanks

Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Delete Spec Table bind to a product got “Fatal error” PHP 8.0.x on admin’ is closed to new replies.