-
-
Notifications
You must be signed in to change notification settings - Fork 9
get_class() expects parameter 1 to be object, null given #15
Comments
Now seeing a similar error on the production site, 3 lines away from the error reported above. This is the log result when certain products are added to cart. The webpage shows internal server error and this is the log result:
|
Hi Andrew, continuing to try to solve this issue. Again, this is happening only for products in a single product type. Other products with other product types are working. Products in this product type used to work. This is the code in the commerce service that is having the issue. Here is the code:
I print_r'd areas of this, and verified that $productVariant and $fieldHandle are set correctly, though $srcField in 473 is null, so it is being set in 474 to $productVariant->product->$fieldHandle, which is showing as an object. So, I don't know why it is failing on 474. I can't figure it out. |
Further testing, it doesn't appear to be product type specific. I created a new product type and moved a faulty product to it, but that didn't change anything. Same error. I guess I'll disable IA for now. |
And here we go again... completely different site, same error on same area of the site. Can I please get some support on this? Its now keeping me from using IA, which I have paid for on 2 different sites, on both sites. Please help. |
So this comes down to the brand field. it really makes no sense that the brand field is something in the IA settings that has to be assigned to products and then chosen for every single product. As I requested in this other open request, the brand setting should be able to be set to a global or a static text that applies to all products. I have over 100 products on 2 different stores, and in both cases, the brand is the same for all 100+ products. Why force me to choose/fill in a brand value on every single product? So, to get around this error for every product, I hacked IA to provide a string for the brand value that is sent to analytics. The error, I am assuming, was coming from me not choosing/filling in a brand value on every single product. Here is the hack if you want to implement it: /site/vendor/nystudio107/craft-instantanalytics/src/services/commerce.php FIND:
Replace:
If I am missing something or there is a non-hacky way to fix this, let me know. It would be great to get some kind of response for this Andrew. |
I'm also getting this same error (using version 1.1.0). I noticed this has been fixed in 1.1.1 but this version isn't available on packagist. Please can you give an ETA on when 1.1.1 will be available to download so we can update the plugin - thanks. |
fixed in 1.1.1 -> https://github.com/nystudio107/craft-instantanalytics/releases/tag/1.1.1 |
On local and dev sites that have devMode on, I am getting this on any template with a product shown on it. Not cart or checkout.
The text was updated successfully, but these errors were encountered: