From 2993373dbaa75932d80eea370b0ea7f0f72c0a66 Mon Sep 17 00:00:00 2001 From: Niek ten Hoopen Date: Thu, 3 Jun 2021 16:03:54 +0200 Subject: [PATCH] Bugfix normalizeValue() for PHP8 compatibility #14 --- CHANGELOG.md | 5 +++++ composer.json | 2 +- src/fields/EntryCoordinates.php | 4 ++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 16a81d0..2637ba7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## 1.3.1 - 2021-06-03 +### Changed +- Bugfix normalizeValue() of EntryCoordinates for PHP8+ (Issue #14) + + ## 1.3.0 - 2020-01-14 ### Added - GraphQL support diff --git a/composer.json b/composer.json index 08a6f8a..52b4089 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "nthmedia/entry-gps-coordinates", "description": "Entry GPS Coordinates plugin for Craft CMS 3.x", "type": "craft-plugin", - "version": "1.3.0", + "version": "1.3.1", "keywords": [ "gps coordinates", "gps", diff --git a/src/fields/EntryCoordinates.php b/src/fields/EntryCoordinates.php index 6437151..f316c46 100644 --- a/src/fields/EntryCoordinates.php +++ b/src/fields/EntryCoordinates.php @@ -115,6 +115,10 @@ public function getContentColumnType(): string */ public function normalizeValue($value, ElementInterface $element = null) { + if ($value instanceof EntryCoordinatesModel) { + return $value; + } + if (is_string($value)) { $value = Json::decodeIfJson($value); }