{"action":"created","issue":{"url":"https://api.github.com/repos/woocommerce/woocommerce/issues/21694","repository_url":"https://api.github.com/repos/woocommerce/woocommerce","labels_url":"https://api.github.com/repos/woocommerce/woocommerce/issues/21694/labels{/name}","comments_url":"https://api.github.com/repos/woocommerce/woocommerce/issues/21694/comments","events_url":"https://api.github.com/repos/woocommerce/woocommerce/issues/21694/events","html_url":"https://github.com/woocommerce/woocommerce/issues/21694","id":374440177,"node_id":"MDU6SXNzdWUzNzQ0NDAxNzc=","number":21694,"title":"Notice: Trying to get property of non-object","user":{"login":"Kerfred","id":4131401,"node_id":"MDQ6VXNlcjQxMzE0MDE=","avatar_url":"https://avatars3.githubusercontent.com/u/4131401?v=4","gravatar_id":"","url":"https://api.github.com/users/Kerfred","html_url":"https://github.com/Kerfred","followers_url":"https://api.github.com/users/Kerfred/followers","following_url":"https://api.github.com/users/Kerfred/following{/other_user}","gists_url":"https://api.github.com/users/Kerfred/gists{/gist_id}","starred_url":"https://api.github.com/users/Kerfred/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kerfred/subscriptions","organizations_url":"https://api.github.com/users/Kerfred/orgs","repos_url":"https://api.github.com/users/Kerfred/repos","events_url":"https://api.github.com/users/Kerfred/events{/privacy}","received_events_url":"https://api.github.com/users/Kerfred/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-10-26T15:41:40Z","updated_at":"2018-11-01T18:47:16Z","closed_at":"2018-11-01T18:19:53Z","author_association":"NONE","body":"**Describe the bug**\r\nSince the last WooCommerce update (3.5.0), I get this notice:\r\n«Notice: Trying to get property of non-object in wp-content/plugins/woocommerce/includes/wc-attribute-functions.php on line 172»\r\nIt is because $wc_product_attributes is considered as an array of objects but is initialized as an array of arrays.\r\n\r\n**To Reproduce**\r\nIn includes/wc-attribute-functions.php on line 172:\r\n`$orderby = $wc_product_attributes[ 'pa_' . $name ]->attribute_orderby;`\r\n$wc_product_attributes[ 'pa_' . $name ] should be an object.\r\n\r\nBut in includes/import/abstract-wc-product-importer.php on line 675:\r\n`$wc_product_attributes[ wc_attribute_taxonomy_name( $taxonomy->attribute_name ) ] = $taxonomy;`\r\n$taxonomy is not an object but an array. It is set in includes/wc-attribute-functions.php on line 60:\r\n`return (array) array_filter( apply_filters( 'woocommerce_attribute_taxonomies', $attribute_taxonomies ) );`\r\n\r\n**Expected behavior**\r\nMake $wc_product_attributes either an array or an object but not use it sometimes as an array and sometimes as an object\r\n\r\n**Isolating the problem (mark completed items with an [x]):**\r\n- [ ] I have deactivated other plugins and confirmed this bug occurs when only WooCommerce plugin is active.\r\n- [X] This bug happens with a default WordPress theme active, or [Storefront](https://woocommerce.com/storefront/).\r\n- [X] I can reproduce this bug consistently using the steps above.\r\n\r\nFor information, this issue happens when I migrate a Magento site to WooCommerce with FG Magento to WooCommerce Premium. I am the owner of this plugin. WooCommerce triggers a notice during the import.\r\nPlease tell me once this bug is fixed, and if you set it as an array of arrays or as an array of objects. And I'll change my plugin accordingly.\r\n\r\nDon't hesitate to ask if you need more informations.\r\n\r\n**WordPress Environment**\r\n<details>\r\n````\r\n### WordPress Environment ###\r\n\r\nHome URL: http://localhost/test/wordpressimport\r\nSite URL: http://localhost/test/wordpressimport\r\nWC Version: 3.5.0\r\nLog Directory Writable: ✔\r\nWP Version: 4.9.8\r\nWP Multisite: –\r\nWP Memory Limit: 2 GB\r\nWP Debug Mode: ✔\r\nWP Cron: ✔\r\nLanguage: en_US\r\nExternal object cache: –\r\n\r\n### Server Environment ###\r\n\r\nServer Info: Apache/2.4.27 (Unix) OpenSSL/1.0.1p PHP/7.1.8\r\nPHP Version: 7.1.8 - We recommend using PHP version 7.2 or above for greater performance and security. How to update your PHP version\r\nPHP Post Max Size: 2 GB\r\nPHP Time Limit: 3600\r\nPHP Max Input Vars: 2000\r\ncURL Version: 7.43.0\r\nOpenSSL/1.0.1p\r\n\r\nSUHOSIN Installed: –\r\nMySQL Version: 5.6.37\r\nMax Upload Size: 2 GB\r\nDefault Timezone is UTC: ✔\r\nfsockopen/cURL: ✔\r\nSoapClient: ✔\r\nDOMDocument: ✔\r\nGZip: ✔\r\nMultibyte String: ✔\r\nRemote Post: ✔\r\nRemote Get: ✔\r\n\r\n### Database ###\r\n\r\nWC Database Version: 3.5.0\r\nWC Database Prefix: wp_\r\nTotal Database Size: 7.78MB\r\nDatabase Data Size: 5.75MB\r\nDatabase Index Size: 2.03MB\r\nwp_woocommerce_sessions: Data: 0.02MB + Index: 0.02MB\r\nwp_woocommerce_api_keys: Data: 0.02MB + Index: 0.03MB\r\nwp_woocommerce_attribute_taxonomies: Data: 0.02MB + Index: 0.02MB\r\nwp_woocommerce_downloadable_product_permissions: Data: 0.02MB + Index: 0.05MB\r\nwp_woocommerce_order_items: Data: 0.02MB + Index: 0.02MB\r\nwp_woocommerce_order_itemmeta: Data: 0.02MB + Index: 0.03MB\r\nwp_woocommerce_tax_rates: Data: 0.02MB + Index: 0.06MB\r\nwp_woocommerce_tax_rate_locations: Data: 0.02MB + Index: 0.03MB\r\nwp_woocommerce_shipping_zones: Data: 0.02MB + Index: 0.00MB\r\nwp_woocommerce_shipping_zone_locations: Data: 0.02MB + Index: 0.03MB\r\nwp_woocommerce_shipping_zone_methods: Data: 0.02MB + Index: 0.00MB\r\nwp_woocommerce_payment_tokens: Data: 0.02MB + Index: 0.02MB\r\nwp_woocommerce_payment_tokenmeta: Data: 0.02MB + Index: 0.03MB\r\nwp_woocommerce_log: Data: 0.02MB + Index: 0.02MB\r\nwp_commentmeta: Data: 0.02MB + Index: 0.03MB\r\nwp_comments: Data: 0.02MB + Index: 0.09MB\r\nwp_fg_redirect: Data: 0.02MB + Index: 0.00MB\r\nwp_icl_content_status: Data: 0.02MB + Index: 0.02MB\r\nwp_icl_core_status: Data: 0.02MB + Index: 0.02MB\r\nwp_icl_flags: Data: 0.02MB + Index: 0.02MB\r\nwp_icl_languages: Data: 0.02MB + Index: 0.03MB\r\nwp_icl_languages_translations: Data: 0.19MB + Index: 0.11MB\r\nwp_icl_locale_map: Data: 0.02MB + Index: 0.00MB\r\nwp_icl_message_status: Data: 0.02MB + Index: 0.03MB\r\nwp_icl_node: Data: 0.02MB + Index: 0.00MB\r\nwp_icl_reminders: Data: 0.02MB + Index: 0.00MB\r\nwp_icl_strings: Data: 0.02MB + Index: 0.06MB\r\nwp_icl_string_positions: Data: 0.02MB + Index: 0.02MB\r\nwp_icl_string_status: Data: 0.02MB + Index: 0.02MB\r\nwp_icl_string_translations: Data: 0.02MB + Index: 0.02MB\r\nwp_icl_translate: Data: 0.02MB + Index: 0.02MB\r\nwp_icl_translate_job: Data: 0.02MB + Index: 0.02MB\r\nwp_icl_translations: Data: 0.02MB + Index: 0.06MB\r\nwp_icl_translation_batches: Data: 0.02MB + Index: 0.00MB\r\nwp_icl_translation_status: Data: 0.02MB + Index: 0.02MB\r\nwp_links: Data: 0.02MB + Index: 0.02MB\r\nwp_ngg_album: Data: 0.02MB + Index: 0.02MB\r\nwp_ngg_gallery: Data: 0.02MB + Index: 0.02MB\r\nwp_ngg_pictures: Data: 0.02MB + Index: 0.02MB\r\nwp_options: Data: 1.52MB + Index: 0.05MB\r\nwp_postmeta: Data: 0.02MB + Index: 0.03MB\r\nwp_posts: Data: 0.02MB + Index: 0.06MB\r\nwp_termmeta: Data: 0.02MB + Index: 0.03MB\r\nwp_terms: Data: 0.02MB + Index: 0.03MB\r\nwp_term_relationships: Data: 0.02MB + Index: 0.02MB\r\nwp_term_taxonomy: Data: 0.02MB + Index: 0.03MB\r\nwp_toolset_associations: Data: 0.02MB + Index: 0.05MB\r\nwp_toolset_post_guid_id: Data: 0.05MB + Index: 0.02MB\r\nwp_toolset_relationships: Data: 0.02MB + Index: 0.08MB\r\nwp_toolset_type_sets: Data: 0.02MB + Index: 0.03MB\r\nwp_usermeta: Data: 0.02MB + Index: 0.03MB\r\nwp_users: Data: 0.02MB + Index: 0.05MB\r\nwp_wc_download_log: Data: 0.02MB + Index: 0.03MB\r\nwp_wc_webhooks: Data: 0.02MB + Index: 0.02MB\r\nwp_yoast_seo_links: Data: 1.45MB + Index: 0.44MB\r\nwp_yoast_seo_meta: Data: 1.52MB + Index: 0.00MB\r\n\r\n### Post Type Counts ###\r\n\r\n\r\n### Security ###\r\n\r\nSecure connection (HTTPS): ❌\r\n\t\t\t\t\tYour store is not using HTTPS. Learn more about HTTPS and SSL Certificates.\r\nHide errors from visitors: ❌Error messages should not be shown to visitors.\r\n\r\n### Active Plugins (13) ###\r\n\r\nFG Debug: by Frédéric GILLES – 1.1.0\r\nFG Drupal to WordPress Premium: by Frédéric GILLES – 1.65.3\r\nFG Joomla to WordPress Premium: by Frédéric GILLES – 3.46.0\r\nFG Magento to WooCommerce Premium Product Options module: by Frédéric GILLES – 1.1.2 – Not tested with the active version of WooCommerce\r\nFG Magento to WooCommerce Premium: by Frédéric GILLES – 2.57.5 – Not tested with the active version of WooCommerce\r\nFG PrestaShop to WooCommerce Premium: by Frédéric GILLES – 3.42.0 – Not tested with the active version of WooCommerce\r\nFG SPIP to WordPress Premium: by Frédéric GILLES – 2.34.0\r\nFG View Protected Meta: by Frédéric GILLES – 1.3.0\r\nToolset Types: by OnTheGoSystems – 3.1.2\r\nWooCommerce Product Add-ons: by WooCommerce – 2.9.0 – 3.0.0 is available – Not tested with the active version of WooCommerce\r\nWooCommerce: by Automattic – 3.5.0\r\nYoast SEO: by Team Yoast – 9.0.2 – Not tested with the active version of WooCommerce\r\nWP Native Dashboard: by Heiko Rabe – 1.3.12\r\n\r\n### Settings ###\r\n\r\nAPI Enabled: –\r\nForce SSL: –\r\nCurrency: EUR (€)\r\nCurrency Position: left\r\nThousand Separator: ,\r\nDecimal Separator: .\r\nNumber of Decimals: 2\r\nTaxonomies: Product Types: \r\nTaxonomies: Product Visibility: \r\n\r\n### WC Pages ###\r\n\r\nShop base: ❌ Page ID is set\r\nbut the page does not exist\r\n\r\nCart: ❌ Page ID is set\r\nbut the page does not exist\r\n\r\nCheckout: ❌ Page ID is set\r\nbut the page does not exist\r\n\r\nMy account: ❌ Page ID is set\r\nbut the page does not exist\r\n\r\nTerms and conditions: ❌ Page not set\r\n\r\n### Theme ###\r\n\r\nName: Twenty Seventeen\r\nVersion: 1.7\r\nAuthor URL: https://wordpress.org/\r\nChild Theme: ❌ – If you are modifying WooCommerce on a parent theme that you did not build personally we recommend using a child theme. See: How to create a child theme\r\nWooCommerce Support: ✔\r\n\r\n### Templates ###\r\n\r\nOverrides: –\r\n````\r\n</details>\r\n"},"comment":{"url":"https://api.github.com/repos/woocommerce/woocommerce/issues/comments/435145202","html_url":"https://github.com/woocommerce/woocommerce/issues/21694#issuecomment-435145202","issue_url":"https://api.github.com/repos/woocommerce/woocommerce/issues/21694","id":435145202,"node_id":"MDEyOklzc3VlQ29tbWVudDQzNTE0NTIwMg==","user":{"login":"Kerfred","id":4131401,"node_id":"MDQ6VXNlcjQxMzE0MDE=","avatar_url":"https://avatars3.githubusercontent.com/u/4131401?v=4","gravatar_id":"","url":"https://api.github.com/users/Kerfred","html_url":"https://github.com/Kerfred","followers_url":"https://api.github.com/users/Kerfred/followers","following_url":"https://api.github.com/users/Kerfred/following{/other_user}","gists_url":"https://api.github.com/users/Kerfred/gists{/gist_id}","starred_url":"https://api.github.com/users/Kerfred/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kerfred/subscriptions","organizations_url":"https://api.github.com/users/Kerfred/orgs","repos_url":"https://api.github.com/users/Kerfred/repos","events_url":"https://api.github.com/users/Kerfred/events{/privacy}","received_events_url":"https://api.github.com/users/Kerfred/received_events","type":"User","site_admin":false},"created_at":"2018-11-01T18:47:16Z","updated_at":"2018-11-01T18:47:16Z","author_association":"NONE","body":"Thank you for this information.\r\nSo I think \"(array)\" should be replaced by \"(object)\" in\r\n`return (array) array_filter( apply_filters( 'woocommerce_attribute_taxonomies', $attribute_taxonomies ) );`\r\nin includes/wc-attribute-functions.php on line 60.\r\nDoes it make sense?\r\n"}}
{"actor":{"display_login":"Kerfred"}}