Error in facebook-server.php on line 188
-
Hi, we have this error coming up:
PHP Warning: Undefined property: stdClass::$RemoveFromCart in /home/customer/www/bean.pt/public_html/wp-content/plugins/pixelyoursite/modules/facebook/facebook-server.php on line 188if(isset($_COOKIE["pys_fb_event_id"])) {
$singleEvent->payload['eventID'] = json_decode(stripslashes($_COOKIE["pys_fb_event_id"]))->RemoveFromCart;
}Its optimist to assume $_COOKIE[“pys_fb_event_id”] will parse correctly, maybe a check like this:
$cookieData = json_decode(stripslashes($_COOKIE[“pys_fb_event_id”]));
if (is_object($cookieData) && property_exists($cookieData, ‘RemoveFromCart’)) {
$singleEvent->payload[‘eventID’] = $cookieData->RemoveFromCart;
}
This of course will only avoid the error and not debug why $_COOKIE[“pys_fb_event_id”] has data but not in the expected format.
- You must be logged in to reply to this topic.