From e0cf58b52014e105327f92cfc30b3b5f2ed69965 Mon Sep 17 00:00:00 2001 From: brandonkelly Date: Tue, 3 Dec 2024 09:16:28 -0800 Subject: [PATCH] Fixed Link's PHP type --- CHANGELOG.md | 1 + src/fields/Link.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bc2eed5a487..83e7d663984 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## Unreleased - Fixed a bug where asset, category, and entry sources defined by the `EVENT_REGISTER_SOURCES` event didn’t have any custom fields available to them, unless the `EVENT_REGISTER_FIELD_LAYOUTS` event was also used to define the available field layouts for the event-defined source. ([#16256](https://github.com/craftcms/cms/discussions/16256)) +- Fixed a bug where Link fields were getting `string` types in `CustomFieldBehavior` rather than `craft\fields\data\LinkData`. ## 5.5.4 - 2024-12-02 diff --git a/src/fields/Link.php b/src/fields/Link.php index b1cba9894f3..2e078a7bd7a 100644 --- a/src/fields/Link.php +++ b/src/fields/Link.php @@ -84,7 +84,7 @@ public static function icon(): string */ public static function phpType(): string { - return 'string|null'; + return sprintf('\\%s|null', LinkData::class); } /**