From 6def22d564d9131b5151fd5a0a7287f850920880 Mon Sep 17 00:00:00 2001 From: Doug Mouncey Date: Wed, 2 Nov 2022 16:31:51 +0000 Subject: [PATCH] Update Normalizer.php Fix to avoid PHP Warning that breaks PHP8. In some circumstances data is sent as an array, but this method expects string. --- src/FacebookAds/Object/ServerSide/Normalizer.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/FacebookAds/Object/ServerSide/Normalizer.php b/src/FacebookAds/Object/ServerSide/Normalizer.php index 17c232f35..fa4458431 100644 --- a/src/FacebookAds/Object/ServerSide/Normalizer.php +++ b/src/FacebookAds/Object/ServerSide/Normalizer.php @@ -39,6 +39,11 @@ class Normalizer { * @return string */ public static function normalize($field, $data) { + + if (is_array($data)) { + $data = $data[0]; + } + if ($data == null || strlen($data) == 0) { return null; }