Title: Uncaught TypeError
Last modified: July 4, 2024

---

# Uncaught TypeError

 *  Resolved [Giuseppe Milo](https://wordpress.org/support/users/pixael/)
 * (@pixael)
 * [1 year, 9 months ago](https://wordpress.org/support/topic/uncaught-typeerror-91/)
 * Hi there and thanks for your plugin.
 * On a customer website, they have noticed that when editing a specific woocommerce
   product in a different language (they use WPML), they can’t see the metabox. 
   They get this error:
   `Uncaught TypeError: array_key_first(): Argument #1 ($array)
   must be of type array, string given in /home2/XXXXX/public_html/wp-content/plugins/
   google-listings-and-ads/src/Product/ProductHelper.php:615Stack trace:#0 /home2/
   XXXXX/public_html/wp-content/plugins/google-listings-and-ads/src/Product/ProductHelper.
   php(615): array_key_first('a:4:{i:4213;a:1...')#1 /home2/XXXXX/public_html/wp-
   content/plugins/google-listings-and-ads/src/Admin/MetaBox/ChannelVisibilityMetaBox.
   php(127): Automattic\WooCommerce\GoogleListingsAndAds\Product\ProductHelper->
   get_validation_errors(Object(WC_Product_Variable))#2 /home2/XXXXX/public_html/
   wp-content/plugins/google-listings-and-ads/src/Admin/MetaBox/AbstractMetaBox.
   php(107): Automattic\WooCommerce\GoogleListingsAndAds\Admin\MetaBox\ChannelVisibilityMetaBox-
   >get_view_context(Object(WP_Post), Array)#3 /home2/XXXXX/public_html/wp-admin/
   includes/template.php(1456): Automattic\WooCommerce\GoogleListingsAndAds\Admin\
   MetaBox\AbstractMetaBox->handle_callback(Object(WP_Post), Array)#4 /home2/XXXXX/
   public_html/wp-admin/edit-form-advanced.php(716): do_meta_boxes(Object(WP_Screen),'
   side', Object(WP_Post))#5 /home2/XXXXX/public_html/wp-admin/post.php(206): require('/
   home2/XXXXX...')#6 {main}
 * It happens on a few products so they can’t edit the meta of those. Can you please
   assist with this?
    -  This topic was modified 1 year, 9 months ago by [Giuseppe Milo](https://wordpress.org/support/users/pixael/).
    -  This topic was modified 1 year, 9 months ago by [Giuseppe Milo](https://wordpress.org/support/users/pixael/).

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

 *  [carolm29 (woo-hc)](https://wordpress.org/support/users/carolm29/)
 * (@carolm29)
 * [1 year, 9 months ago](https://wordpress.org/support/topic/uncaught-typeerror-91/#post-17869099)
 * Hey there, [@pixael](https://wordpress.org/support/users/pixael/)! Thanks for
   contacting us. I’m happy to help you.
 * As I understand the issue only happens when using WPML, correct?
 * Have you reached out to their support? Since the issue only happens when using
   their plugin, we are not able to help with it and they would be more suited to
   assist you in figuring out what is happening 🙂
 * If the issue is also happening without using WPML, please let us know so we can
   assist you further.
 * Please let us know if there’s anything else we can do to help or if you have 
   any questions.
 * Have a wonderful day!
 *  Thread Starter [Giuseppe Milo](https://wordpress.org/support/users/pixael/)
 * (@pixael)
 * [1 year, 9 months ago](https://wordpress.org/support/topic/uncaught-typeerror-91/#post-17870329)
 * Thanks I will.
 *  [ckadenge (woo-hc)](https://wordpress.org/support/users/ckadenge/)
 * (@ckadenge)
 * [1 year, 9 months ago](https://wordpress.org/support/topic/uncaught-typeerror-91/#post-17870354)
 * Hi [@pixael](https://wordpress.org/support/users/pixael/),
 * Sounds like a plan.
 * Please keep us updated on how it goes. In the meantime, I’ll go ahead and mark
   this thread as solved.
 * Should you still need further assistance, feel free to [open a new thread](https://wordpress.org/support/plugin/google-listings-and-ads/?view=all#new-topic-0).
 *  Thread Starter [Giuseppe Milo](https://wordpress.org/support/users/pixael/)
 * (@pixael)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/uncaught-typeerror-91/#post-17892137)
 * Hi, I’ve found that your plugin was saving postmeta with broken serialized data.
   This was braking the whole editing page. My customer wasn’t able to modify woocommerce
   products.
 * In particular the broken postmeta had meta_key **_wc_gla_errors** with values
   like these:
   `s:118:"a:2:{i:4143;a:1:{s:13:"internalError";s:14:"Internal error";}
   i:4144;a:1:{s:13:"internalError";s:14:"Internal error";}}";`
 * This will unserialize in a string, not an array.
 * You may look into this.
 *  [Zee](https://wordpress.org/support/users/doublezed2/)
 * (@doublezed2)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/uncaught-typeerror-91/#post-17892625)
 * Hello [Giuseppe Milo](https://wordpress.org/support/users/pixael/)
 * Thank you for your reply.
 * To confirm are you using the latest version of Google Listings & Ads **2.7.6**?
 * May I ask in which table did you find these values?
   This will help me create 
   a report so the dev team and look into it.
 * Looking forward to your response. 🙂
 * Best regards.
 *  Thread Starter [Giuseppe Milo](https://wordpress.org/support/users/pixael/)
 * (@pixael)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/uncaught-typeerror-91/#post-17892627)
 * Hi
   yes, I’m using the latest version. Post meta are stored in the wp core table
   PREFIX_postmeta.
 *  [anastas10s](https://wordpress.org/support/users/anastas10s/)
 * (@anastas10s)
 * [1 year, 8 months ago](https://wordpress.org/support/topic/uncaught-typeerror-91/#post-17893172)
 * Thank you for reaching back, clarifying things further [@pixael](https://wordpress.org/support/users/pixael/).
 * Best if you go ahead with creating a report, over at GitHub, [via this screen](https://github.com/woocommerce/google-listings-and-ads/issues/new/choose).
 * Thank you.

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

The topic ‘Uncaught TypeError’ is closed to new replies.

 * ![](https://ps.w.org/google-listings-and-ads/assets/icon.svg?rev=2775988)
 * [Google for WooCommerce](https://wordpress.org/plugins/google-listings-and-ads/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/google-listings-and-ads/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/google-listings-and-ads/)
 * [Active Topics](https://wordpress.org/support/plugin/google-listings-and-ads/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/google-listings-and-ads/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/google-listings-and-ads/reviews/)

 * 7 replies
 * 5 participants
 * Last reply from: [anastas10s](https://wordpress.org/support/users/anastas10s/)
 * Last activity: [1 year, 8 months ago](https://wordpress.org/support/topic/uncaught-typeerror-91/#post-17893172)
 * Status: resolved