• Resolved leemon

    (@leemon)


    I updated to version 2.9.0 of the plugin and now I’m getting a blank page and the following error when visiting a coupon product page:

    Uncaught TypeError: unserialize(): Argument #1 ($data) must be of type string, array given in /srv/vhost/example.com/home/html/wp-content/plugins/yith-woocommerce-gift-cards/templates/yith-gift-cards/gift-card-design.php:34
    Stack trace:
    #0 /srv/vhost/example.com/home/html/wp-content/plugins/yith-woocommerce-gift-cards/templates/yith-gift-cards/gift-card-design.php(34): unserialize(Array)
    #1 /srv/vhost/example.com/home/html/wp-content/plugins/woocommerce/includes/wc-core-functions.php(345): include('/srv/vhost/edic...')
    #2 /srv/vhost/example.com/home/html/wp-content/plugins/yith-woocommerce-gift-cards/lib/class-yith-ywgc-frontend.php(504): wc_get_template('yith-gift-cards...', Array, '', '/srv/vhost/edic...')
    #3 /srv/vhost/example.com/home/html/wp-includes/class-wp-hook.php(307): YITH_YWGC_Frontend->show_design_section(Object(WC_Product_Gift_Card))
    #4 /srv/vhost/example.com/home/html/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters('', Array)
    #5 /srv/vhost/example.com/home/html/wp-includes/plugin.php(474): WP_Hook->do_action(Array)
    #6 /srv/vhost/example.com/home/html/wp-content/plugins/yith-woocommerce-gift-cards/templates/single-product/add-to-cart/gift-card.php(38): do_action('yith_ywgc_gift_...', Object(WC_Product_Gift_Card))
    #7 /srv/vhost/example.com/home/html/wp-content/plugins/woocommerce/includes/wc-core-functions.php(345): include('/srv/vhost/edic...')
    #8 /srv/vhost/example.com/home/html/wp-content/plugins/yith-woocommerce-gift-cards/lib/class-yith-ywgc-frontend.php(189): wc_get_template('single-product/...', '', '', '/srv/vhost/edic...')
    #9 /srv/vhost/example.com/home/html/wp-includes/class-wp-hook.php(307): YITH_YWGC_Frontend->show_gift_card_product_template('')
    #10 /srv/vhost/example.com/home/html/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters(NULL, Array)
    #11 /srv/vhost/example.com/home/html/wp-includes/plugin.php(474): WP_Hook->do_action(Array)
    #12 /srv/vhost/example.com/home/html/wp-content/plugins/woocommerce/templates/content-single-product.php(60): do_action('woocommerce_sin...')
    #13 /srv/vhost/example.com/home/html/wp-includes/template.php(772): require('/srv/vhost/edic...')
    #14 /srv/vhost/example.com/home/html/wp-content/plugins/woocommerce/includes/wc-core-functions.php(284): load_template('/srv/vhost/edic...', false)
    #15 /srv/vhost/example.com/home/html/wp-content/plugins/woocommerce/templates/single-product.php(37): wc_get_template_part('content', 'single-product')
    #16 /srv/vhost/example.com/home/html/wp-includes/template-loader.php(106): include('/srv/vhost/edic...')
    #17 /srv/vhost/example.com/home/html/wp-blog-header.php(19): require_once('/srv/vhost/edic...')
    #18 /srv/vhost/example.com/home/html/index.php(17): require('/srv/vhost/edic...')
    #19 {main}
      thrown in <b>/srv/vhost/example.com/home/html/wp-content/plugins/yith-woocommerce-gift-cards/templates/yith-gift-cards/gift-card-design.php</b> on line 34
    • This topic was modified 4 years, 1 month ago by leemon.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter leemon

    (@leemon)

    I “fixed” my issue changing line 34 in the gift-card-design.php file to:

    $selected_categories_unserialized = $selected_categories;

    Apparently, get_post_meta( $post->ID, 'selected_images_categories', true ); already returns an array, not a string that needs unserializing.

    Hello there,
    hope you’re doing well 🙂

    We have sent this report to the developer and it will be fixed in the next update. Thank you very much for your report.

    Have a nice day!

    Thread Starter leemon

    (@leemon)

    Thanks!

    Thread Starter leemon

    (@leemon)

    I updated to 2.10.0 and the bug is still there. But I see that it only happens in combination with a multilingual plugin such as Polylang. If I set three languages (for example: EN, ES, FR) and set EN as the default language, the bug only appears in the ES and FR versions of the gift card page.

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

The topic ‘Error with version 2.9.0’ is closed to new replies.