Filters (widgets) – Trying to get property of non-object
-
Hi,
When using the widget filters in the sidebar, if WordPress is in debug mode I am getting these errors:
Notice: Trying to get property of non-object in [url]/wp-content/plugins/woocommerce/includes/class-wc-query.php on line 713
Notice: Trying to get property of non-object in [url]/wp-content/plugins/woocommerce/includes/class-wc-query.php on line 725
The filters seem to work ok with debug turned off, however this seems like an error that needs fixing – does anyone have a fix?
Thanks
Rob
-
Hey there!
I’d like to try replicating this on my end, but I’ll need a bit more information about your setup.
Could you please share a copy of your site’s System Status? You can find it via WooCommerce > Status.
Select “Get system report” and then “Copy for support”.? Once you’ve done that, paste it here in your response.Sure no problem…
### WordPress Environment ### Home URL: [private / local] Site URL: [private / local] WC Version: 3.5.1 Log Directory Writable: ? WP Version: 4.9.8 WP Multisite: – WP Memory Limit: 256 MB WP Debug Mode: ? WP Cron: ? Language: en_US External object cache: – ### Server Environment ### Server Info: Apache PHP Version: 7.0.20 - We recommend using PHP version 7.2 or above for greater performance and security. How to update your PHP version PHP Post Max Size: 5 GB PHP Time Limit: 30 PHP Max Input Vars: 1000 cURL Version: 7.52.1 OpenSSL/1.0.2j SUHOSIN Installed: – MySQL Version: 5.6.35 Max Upload Size: 500 MB Default Timezone is UTC: ? fsockopen/cURL: ? SoapClient: ? DOMDocument: ? GZip: ? Multibyte String: ? Remote Post: ? Remote Get: ? ### Database ### WC Database Version: 3.5.1 WC Database Prefix: bmw_ MaxMind GeoIP Database: ? Total Database Size: 21.13MB Database Data Size: 12.44MB Database Index Size: 8.69MB bmw_woocommerce_sessions: Data: 0.02MB + Index: 0.02MB bmw_woocommerce_api_keys: Data: 0.02MB + Index: 0.03MB bmw_woocommerce_attribute_taxonomies: Data: 0.02MB + Index: 0.02MB bmw_woocommerce_downloadable_product_permissions: Data: 0.02MB + Index: 0.05MB bmw_woocommerce_order_items: Data: 0.02MB + Index: 0.02MB bmw_woocommerce_order_itemmeta: Data: 0.02MB + Index: 0.03MB bmw_woocommerce_tax_rates: Data: 0.02MB + Index: 0.06MB bmw_woocommerce_tax_rate_locations: Data: 0.02MB + Index: 0.03MB bmw_woocommerce_shipping_zones: Data: 0.02MB + Index: 0.00MB bmw_woocommerce_shipping_zone_locations: Data: 0.02MB + Index: 0.03MB bmw_woocommerce_shipping_zone_methods: Data: 0.02MB + Index: 0.00MB bmw_woocommerce_payment_tokens: Data: 0.02MB + Index: 0.02MB bmw_woocommerce_payment_tokenmeta: Data: 0.02MB + Index: 0.03MB bmw_woocommerce_log: Data: 0.02MB + Index: 0.02MB bmw_commentmeta: Data: 0.02MB + Index: 0.03MB bmw_comments: Data: 0.02MB + Index: 0.09MB bmw_db7_forms: Data: 0.02MB + Index: 0.00MB bmw_icl_content_status: Data: 0.02MB + Index: 0.02MB bmw_icl_core_status: Data: 0.02MB + Index: 0.02MB bmw_icl_flags: Data: 0.02MB + Index: 0.02MB bmw_icl_languages: Data: 0.02MB + Index: 0.03MB bmw_icl_languages_translations: Data: 0.19MB + Index: 0.11MB bmw_icl_locale_map: Data: 0.02MB + Index: 0.00MB bmw_icl_message_status: Data: 0.02MB + Index: 0.03MB bmw_icl_mo_files_domains: Data: 0.02MB + Index: 0.02MB bmw_icl_node: Data: 0.02MB + Index: 0.00MB bmw_icl_reminders: Data: 0.02MB + Index: 0.00MB bmw_icl_strings: Data: 2.52MB + Index: 3.81MB bmw_icl_string_packages: Data: 0.02MB + Index: 0.00MB bmw_icl_string_pages: Data: 0.02MB + Index: 0.02MB bmw_icl_string_positions: Data: 0.02MB + Index: 0.02MB bmw_icl_string_status: Data: 0.02MB + Index: 0.02MB bmw_icl_string_translations: Data: 6.52MB + Index: 3.52MB bmw_icl_string_urls: Data: 0.02MB + Index: 0.02MB bmw_icl_translate: Data: 0.02MB + Index: 0.02MB bmw_icl_translate_job: Data: 0.02MB + Index: 0.02MB bmw_icl_translations: Data: 0.02MB + Index: 0.06MB bmw_icl_translation_batches: Data: 0.02MB + Index: 0.00MB bmw_icl_translation_status: Data: 0.02MB + Index: 0.02MB bmw_links: Data: 0.02MB + Index: 0.02MB bmw_options: Data: 2.05MB + Index: 0.05MB bmw_postmeta: Data: 0.11MB + Index: 0.06MB bmw_posts: Data: 0.06MB + Index: 0.06MB bmw_rednao_wc_invoice: Data: 0.02MB + Index: 0.00MB bmw_rednao_wc_invoices_created: Data: 0.02MB + Index: 0.00MB bmw_rednao_wc_invoices_custom_field: Data: 0.02MB + Index: 0.00MB bmw_termmeta: Data: 0.02MB + Index: 0.03MB bmw_terms: Data: 0.02MB + Index: 0.03MB bmw_term_relationships: Data: 0.02MB + Index: 0.02MB bmw_term_taxonomy: Data: 0.02MB + Index: 0.03MB bmw_usermeta: Data: 0.05MB + Index: 0.03MB bmw_users: Data: 0.02MB + Index: 0.05MB bmw_wc_download_log: Data: 0.02MB + Index: 0.03MB bmw_wc_webhooks: Data: 0.02MB + Index: 0.02MB ### Post Type Counts ### acf-field: 12 acf-field-group: 4 attachment: 20 customize_changeset: 1 nav_menu_item: 8 page: 36 post: 3 product: 3 revision: 11 um_directory: 1 um_form: 3 wpcf7_contact_form: 1 ### Security ### Secure connection (HTTPS): ? Your store is not using HTTPS. Learn more about HTTPS and SSL Certificates. Hide errors from visitors: ?Error messages should not be shown to visitors. ### Active Plugins (12) ### WPML Multilingual CMS: by OnTheGoSystems – 4.0.8 Adminimize: by Frank Bültge – 1.11.4 Advanced Custom Fields PRO: by Elliot Condon – 5.7.7 Contact Form 7: by Takayuki Miyoshi – 5.0.5 Contact Form CFDB7: by Arshid – 1.2.4.1 Invoice Gateway For WooCommerce: by Rymera Web Co – 1.0.0 – Not tested with the active version of WooCommerce Ultimate Member: by Ultimate Member – 2.0.29 Ultimate Member - WooCommerce: by Ultimate Member – 2.0.9 – Not tested with the active version of WooCommerce WooCommerce Multilingual: by OnTheGoSystems – 4.3.7 WooCommerce: by Automattic – 3.5.1 WPML String Translation: by OnTheGoSystems – 2.8.8 WPML Translation Management: by OnTheGoSystems – 2.6.8 ### Settings ### API Enabled: – Force SSL: – Currency: EUR (€) Currency Position: left Thousand Separator: , Decimal Separator: . Number of Decimals: 2 Taxonomies: Product Types: external (external) grouped (grouped) simple (simple) variable (variable) Taxonomies: Product Visibility: exclude-from-catalog (exclude-from-catalog) exclude-from-search (exclude-from-search) featured (featured) outofstock (outofstock) rated-1 (rated-1) rated-2 (rated-2) rated-3 (rated-3) rated-4 (rated-4) rated-5 (rated-5) ### WC Pages ### Shop base: #17 - /shop/ Cart: #18 - /basket/ Checkout: #19 - /checkout/ My account: #20 - /my-account/ Terms and conditions: ? Page visibility should be public ### Theme ### Name: [private] Version: 2.0 Author URL: [private] Child 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 WooCommerce Support: ? Not declared ### Templates ### Overrides: bmw/woocommerce/myaccount/dashboard.php bmw/woocommerce/myaccount/downloads.php bmw/woocommerce/myaccount/form-add-payment-method.php bmw/woocommerce/myaccount/form-edit-account.php bmw/woocommerce/myaccount/form-edit-address.php bmw/woocommerce/myaccount/form-login.php bmw/woocommerce/myaccount/form-lost-password.php bmw/woocommerce/myaccount/form-reset-password.php bmw/woocommerce/myaccount/lost-password-confirmation.php bmw/woocommerce/myaccount/my-account.php bmw/woocommerce/myaccount/my-address.php bmw/woocommerce/myaccount/my-downloads.php bmw/woocommerce/myaccount/my-orders.php bmw/woocommerce/myaccount/navigation.php bmw/woocommerce/myaccount/orders.php bmw/woocommerce/myaccount/payment-methods.php bmw/woocommerce/myaccount/view-order.php
Hi Hannah (@fernashes) – any luck replicating / resolving this?
Hey there! Thanks for the follow up. ??
I’d asked for the system status report for a number of reasons, among others wanting to know which theme you were using or being able to check your site to find out. That would have also let me know which filters you were using. I’ve made a few assumptions with testing.
* Using WP 5.0 RC5 and WC 3.5.1
* Ensured wp-debug is enabled and displaying on screen
* Storefront theme
* Added Filter Products by Attribute and Filter Products By Rating widgets to sidebar
* Checked for notices > noneGiven that I’m not able to reproduce this on my test site and the text of the notices given, this is likely a plugin and/or theme conflict on your site.
The best way to determine if the issue is being caused by a theme and/or plugin is to temporarily switch your theme to Storefront and disable all plugins except for WooCommerce. If you can install plugins, install Health Check. On the troubleshooting tab, you can click the button to disable all plugins and change the theme for you while you’re logged in to that session without affecting normal visitors to your site. Note that Health Check may not count Storefront as a default theme, so you can also use Twenty Seventeen as well.
If you’re not seeing the same problem after completing the conflict test, then you know the problem was with the plugins and/or theme you deactivated. To figure out which plugin is causing the problem, continue to the next step.5. Reactivate your other plugins one by one, testing after each, until you find the one causing conflict.
We haven’t heard back from you in a while, so I’m going to mark this as resolved – if you have any further questions, you can start a new thread.
- The topic ‘Filters (widgets) – Trying to get property of non-object’ is closed to new replies.