diff --git a/mailpoet/lib/API/MP/v1/Segments.php b/mailpoet/lib/API/MP/v1/Segments.php index a2b02a734d..c5f16bc715 100644 --- a/mailpoet/lib/API/MP/v1/Segments.php +++ b/mailpoet/lib/API/MP/v1/Segments.php @@ -66,7 +66,7 @@ class Segments { $data['description'] ?? '', SegmentEntity::TYPE_DEFAULT, [], - $data['id'] + (int)$data['id'] ); } catch (\Exception $e) { throw new APIException( diff --git a/mailpoet/tests/integration/API/MP/SegmentsTest.php b/mailpoet/tests/integration/API/MP/SegmentsTest.php index 2def747beb..0d715761a3 100644 --- a/mailpoet/tests/integration/API/MP/SegmentsTest.php +++ b/mailpoet/tests/integration/API/MP/SegmentsTest.php @@ -17,7 +17,6 @@ use MailPoet\Segments\SegmentsRepository; use MailPoet\Subscribers\SubscriberSegmentRepository; use MailPoet\Test\DataFactories\Form; use MailPoet\Test\DataFactories\Newsletter; -use MailPoet\Test\DataFactories\NewsletterOption; use MailPoet\Test\DataFactories\Segment as SegmentFactory; use MailPoet\Test\DataFactories\Subscriber; @@ -159,7 +158,7 @@ class SegmentsTest extends \MailPoetTest { ); $data = [ - 'id' => $segment->getId(), + 'id' => (string)$segment->getId(), 'name' => 'new name', 'description' => 'updated description', ];