SOLVED: Persistent PHP Notice: Trying to get property 'term_id' of non-object in WooCommerce Product Filters

Hello Bricks Community

I am writing to report a persistent PHP Notice I’m encountering on my website, which appears to be related to the Bricks theme’s integration with WooCommerce, specifically concerning product filters.

The exact notice in my debug log is: PHP Notice: Trying to get property 'term_id' of non-object in /home/q3a8tno/public_html/wp-content/themes/bricks/includes/woocommerce/elements/woocommerce-products-filter.php on line 1064 (and similar notices for name on line 1065)

These notices appear repeatedly in my debug log when Browse or interacting with WooCommerce product pages and filters on my site. While my site appears visually functional on the frontend, these notices are consistently being logged, indicating an underlying issue.

Troubleshooting Steps Already Performed:

To thoroughly diagnose this, I have performed the following comprehensive troubleshooting steps:

  1. WordPress Debugging Enabled: WP_DEBUG and WP_DEBUG_LOG are enabled to capture all notices and warnings.

  2. Clean Bricks Theme Reinstallation:

  • I exported my Bricks templates and theme settings.

  • I activated a default WordPress theme.

  • I completely deleted the Bricks theme files.

  • I re-uploaded and installed a fresh copy of the latest Bricks theme (version 1.12.4, as seen in install logs).

  • I reactivated the freshly installed Bricks theme.

  • Crucially, the PHP notices appeared immediately after activating the fresh Bricks theme, reading my existing settings from the database (I did not re-import settings from my backup at this diagnostic stage). This indicates the issue is present even with the latest theme files.

  1. Clean WooCommerce Reinstallation: I also performed a full deactivation, deletion, and reinstallation of the WooCommerce plugin (Version 9.9.5), along with its official add-ons (Stripe Gateway, Tax, Order Tip, Update Manager), ensuring a fresh install of the e-commerce core.

  2. Other Plugin Reinstallations: Wordfence Security and Amelia plugins were also recently reinstalled to rule out other conflicts.

  3. Caches Cleared: All site, server, and browser caches have been thoroughly cleared after each step.

Conclusion:

Given that the notices persist even after a clean reinstallation of both Bricks theme files and WooCommerce plugin files, and occur with existing settings (indicating the issue isn’t a fresh misconfiguration), it strongly suggests a bug within the Bricks theme’s core code related to its WooCommerce product filter element.

Site Details:

  • Bricks Theme Version: 1.12.4

  • WooCommerce Version: 9.9.5

  • PHP Version: 8.3

  • Debug Log: I have a copy of my debug.log file showing these notices, which I can provide if requested.

Could you please investigate this issue and advise on a potential fix or a future theme update that will address this bug?

Thank you for your time and assistance.

:thinking: wondering if Advanced Custom Fields could have anything to do with this? thanks!

Hi @erinreye707 ,

I just replied to your email. I believe your Product Filter element selected a deleted taxonomy and triggers this error. (Yep, maybe you used ACF created the custom taxonomy before and the setting still left in the element and then you deleted or deactivated the ACF plugin)

(If you are not sure what I meant, please reply to my email and provide admin access so I can log in and check)

Anyway, this is a small bug in Bricks that we should validate if the selected taxonomy is valid before proceeding with the other code, so you wouldn’t trigger those notices. I have recorded this in the bug tracker and will tackle it ASAP.

Regards,
Jenn

We’ve fixed this issue in Bricks 2.0 RC2, now available as a manual download in your account (see changelog).

Please let us know if you are still experiencing issues.

As with any pre-stable release, please do not use it on a production website. It is intended for testing in a local or staging environment only.