From 30492dcdf9312f777dbac6c375ce153c3efd12ae Mon Sep 17 00:00:00 2001 From: Tom Schulze Date: Mon, 4 Jul 2022 13:49:53 +0200 Subject: [PATCH] fix value rendering --- CHANGELOG.md | 12 +++++++++--- README.md | 5 +++-- composer.json | 5 ++--- src/fields/ReadonlyField.php | 2 +- 4 files changed, 15 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 25a9b20..9d3fd35 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,10 @@ -# Read-only Field Changelog +# Release Notes for Read-only field Plugin + +## 2.0.1 - 2022-07-04 + +### Fixed + +- Fixed value rendering. ## 2.0.0 - 2022-04-29 @@ -17,11 +23,11 @@ ## 1.0.1 - 2019-09-14 ### Added -- + - Support for Feed-Me plugin ## 1.0.0 - 2019-04-06 ### Added -- + - Initial release diff --git a/README.md b/README.md index bcfbe05..8e19feb 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ Sometimes you add content to Craft entries (for example via an API) that should ## Requirements - * Craft CMS >= 4.0.0 +* Craft CMS >= 4.0.0 ## Installation @@ -19,9 +19,10 @@ Open your terminal and go to your Craft project: ``` shell cd /path/to/project composer require codemonauts/craft-readonly-field +./craft plugin/install readonly ``` -In the control panel, go to Settings → Plugins and click the “install” button for *Read-only Field*. +You can also install the plugin via the Plugin Store in the Craft Control Panel. ## Usage diff --git a/composer.json b/composer.json index 06b46cc..312b9b3 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "codemonauts/craft-readonly-field", "description": "Craft CMS plugin to add a simple, read-only plaintext field.", - "version": "2.0.0", + "version": "2.0.1", "type": "craft-plugin", "keywords": [ "craft", @@ -24,8 +24,7 @@ "issues": "https://github.com/codemonauts/craft-readonly-field/issues" }, "require": { - "craftcms/cms": "^4.0.0-alpha", - "php": "^8.0" + "craftcms/cms": "^4.0.0" }, "autoload": { "psr-4": { diff --git a/src/fields/ReadonlyField.php b/src/fields/ReadonlyField.php index ca6fb19..ebf2809 100644 --- a/src/fields/ReadonlyField.php +++ b/src/fields/ReadonlyField.php @@ -110,7 +110,7 @@ public function getTableAttributeHtml(mixed $value, ElementInterface $element): * @throws \Twig\Error\LoaderError * @throws \Twig\Error\SyntaxError */ - private function renderValue(?string $value, ElementInterface $element): string + private function renderValue(?string $value, ElementInterface $element): ?string { if ($this->template !== null) { try {