Closed jolappi closed 1 year ago
Hi @jolappi ,
Sorry for the late reply, you're totaly right. Even more, the Facebook library expects the Pixel id as string as well. It is fixed in the latest release.
Thank you for reporting!
@Diewy Has this been reverted?
I'm getting the error in Craft 4: dwy\FacebookConversion\models\Settings::getPixelId(): Return value must be of type ?int, string returned
In file: dwy/facebook-conversion/src/models/Settings.php
the return type of getPixelId()
is set to ?int
. We use environment variables to set the Pixel ID, and these are always set as strings.
Ah, the variable is set to type string, PHPdoc too, but the return type of the method still says ?int
, which gives a TypeError in newer PHP versions.
You are absolutely right. Should be fixed now.
Thanks for the quick fix!
Problem is that getpixelId function try's to get id as integer and in 32bit systems that integer overflows and id will be wrong. And another problem is that settings returns id as string so it will end in php error. But fix is simple and it is done to Settings.php just change pixelid to be string instead of int public function rules(): array { return [ [['pixelId', 'accessToken'], 'required'], ['pixelId', 'string'], ]; }