From 45ada3fe68a30d7858820c51ced629816d413748 Mon Sep 17 00:00:00 2001 From: Basil Suter Date: Thu, 12 Apr 2018 13:57:45 +0200 Subject: [PATCH] fix bug with not wirteable attributes https://github.com/luyadev/luya-kickstarter/issues/23 --- CHANGELOG.md | 4 ++++ src/ngrest/plugins/Text.php | 2 +- src/ngrest/plugins/Textarea.php | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c75f25852f..5ae0403226 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ All notable changes to this project will be documented in this file. This project make usage of the [Yii Versioning Strategy](https://github.com/yiisoft/yii2/blob/master/docs/internals/versions.md). In order to read more about upgrading and BC breaks have a look at the [UPGRADE Document](UPGRADE.md). +## 1.1.1.1 (12. April 2018) + ++ [#23](https://github.com/luyadev/luya-kickstarter/issues/23) Fix issue with not writeable attributes on assign. + ## 1.1.1 (11. April 2018) ### Added diff --git a/src/ngrest/plugins/Text.php b/src/ngrest/plugins/Text.php index cce423ba63..d3591bf58b 100644 --- a/src/ngrest/plugins/Text.php +++ b/src/ngrest/plugins/Text.php @@ -67,7 +67,7 @@ public function onAfterFind($event) */ public function onAssign($event) { - if (!$this->i18n && $this->encoding) { + if (!$this->i18n && $this->encoding && $this->isAttributeWriteable($event)) { $event->sender->setAttribute($this->name, Html::encode($event->sender->getAttribute($this->name))); } } diff --git a/src/ngrest/plugins/Textarea.php b/src/ngrest/plugins/Textarea.php index 715768ba5b..a627894883 100644 --- a/src/ngrest/plugins/Textarea.php +++ b/src/ngrest/plugins/Textarea.php @@ -96,7 +96,7 @@ public function onAfterFind($event) */ public function onAssign($event) { - if (!$this->i18n && $this->encoding) { + if (!$this->i18n && $this->encoding && $this->isAttributeWriteable($event)) { $event->sender->setAttribute($this->name, Html::encode($event->sender->getAttribute($this->name))); } }