Skip to content

Commit

Permalink
Fixed issue where rule options are not passed to rule generator. closes
Browse files Browse the repository at this point in the history
  • Loading branch information
nadar committed Jan 24, 2018
1 parent f1e7dea commit 2bfac10
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 41 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

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).

## 1.0.7 (in progress)

## 1.0.7 (24. January 2018)

+ [#15](https://github.com/luyadev/luya-module-contactform/issues/15) Fixed issue where rule options are not passed to rule generator.

## 1.0.6 (2. January 2018)

Expand Down
74 changes: 36 additions & 38 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion src/controllers/DefaultController.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ public function actionIndex()

foreach ($this->module->rules as $rule) {
if (is_array($rule) && isset($rule[0], $rule[1])) {
$model->addRule($rule[0], $rule[1], isset($rule[2]) ? $rule[2] : []);
$attributes = $rule[0];
$validator = $rule[1];
unset($rule[0], $rule[1]);
$model->addRule($attributes, $validator, $rule);
} else {
throw new InvalidConfigException('Invalid validation rule: a rule must specify both attribute names and validator type.');
}
Expand Down

0 comments on commit 2bfac10

Please sign in to comment.