Skip to content

Commit

Permalink
add option to disable auto assign
Browse files Browse the repository at this point in the history
  • Loading branch information
nadar committed Jan 24, 2020
1 parent f6a6d54 commit 65d8e5e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
12 changes: 12 additions & 0 deletions src/ngrest/plugins/Select.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 65d8e5e

Please sign in to comment.