diff --git a/CHANGELOG.md b/CHANGELOG.md index dfdd79f8e3..848064243f 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,8 @@ In order to read more about upgrading and BC breaks have a look at the [UPGRADE + [#264](https://github.com/luyadev/luya-module-admin/issues/264) Added new `readonly` option to NgRest Plugins which will render the list value in update scope. ### Fixed + ++ [#439](https://github.com/luyadev/luya-module-admin/issues/439) Add option to dissabled auto assign of select data after find. + [#441](https://github.com/luyadev/luya-module-admin/issues/441) Fixed switching of the "check_circle" text to the real icon after successful authentication + [#435](https://github.com/luyadev/luya-module-admin/issues/435) Problem when clicking on checkboxes when initvalue is true (active) state. + [#426](https://github.com/luyadev/luya-module-admin/issues/426) Fixed a bug where color plugin does not work when model is empty. diff --git a/src/ngrest/plugins/Select.php b/src/ngrest/plugins/Select.php index 10641f486e..dec4bd805d 100644 --- a/src/ngrest/plugins/Select.php +++ b/src/ngrest/plugins/Select.php @@ -34,6 +34,14 @@ abstract class Select extends Plugin */ public $emptyListValue = "-"; + /** + * @var boolean If enabeld, which is default, the selected value will be automaticcaly assigned with the model attribute and override its default + * value from the database. This might be a problem when working with relations. + * @see https://github.com/luyadev/luya-module-admin/issues/439 + * @since 3.0.0 + */ + public $assignAfterFind = true; + /** * Getter method for data array. * @@ -92,6 +100,10 @@ public function serviceData($event) */ public function onAfterListFind($event) { + if (!$this->assignAfterFind) { + return parent::onAfterListFind($event); + } + $value = StringHelper::typeCast($event->sender->getAttribute($this->name)); if ($this->scheduling) {