Problem/Motivation
When an Order Item without an purchasable entity is completed in an order (in our case a "Donation" item) Simple Facebook Pixel throws the following error:
Error: Call to a member function getSku() on null in Drupal\simple_facebook_pixel\EventSubscriber\PixelSubscriber->purchaseEvent() (line 215 of modules/contrib/simple_facebook_pixel/src/EventSubscriber/PixelSubscriber.php).
Steps to reproduce
Create an Order Item that has no purchasable entity. Set Simple Facebook Pixel to track Purchase in the admin (/admin/config/system/simple-facebook-pixel). Complete checkout and you will see the error
Proposed resolution
Check for Null case on Order Item Purchased Entity
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | simple_facebook_pixel-3390396-3.patch | 1.62 KB | code-brighton |
Issue fork simple_facebook_pixel-3390396
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
code-brighton commentedAdded patch from merge request
Comment #4
gnikolovskiComment #6
gnikolovski