Skip to content

Commit

Permalink
Fixed unexpected form submit on validate() call
Browse files Browse the repository at this point in the history
Fixed `validate()` method in `yii.activeForm.js` to prevent unexpected form submit
when `forceValidate` set to `true`

Closes #13105
  • Loading branch information
SilverFire committed Dec 11, 2016
1 parent 8e0af24 commit 7d494c1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions framework/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Yii Framework 2 Change Log
- Bug #13159: Fixed `destroy` method in `yii.captcha.js` which did not work as expected (arogachev)
- Bug #7727: Fixed truncateHtml leaving extra tags (developeruz)
- Bug #13118: Fixed `handleAction()` function in `yii.js` to handle attribute `data-pjax=0` as disabled PJAX (silverfire)
- Bug #13105: Fixed `validate()` method in `yii.activeForm.js` to prevent unexpected form submit when `forceValidate` set to `true` (silverfire)
- Enh #475: Added Bash and Zsh completion support for the `./yii` command (cebe, silverfire)
- Enh #6242: Access to validator in inline validation (arogachev)
- Enh #6373: Introduce `yii\db\Query::emulateExecution()` to force returning an empty result for a query (klimov-paul)
Expand Down
4 changes: 2 additions & 2 deletions framework/assets/yii.activeForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -306,9 +306,9 @@
needAjaxValidation = false,
messages = {},
deferreds = deferredArray(),
submitting = data.submitting;
submitting = data.submitting && !forceValidate;

if (submitting) {
if (data.submitting) {
var event = $.Event(events.beforeValidate);
$form.trigger(event, [messages, deferreds]);

Expand Down

0 comments on commit 7d494c1

Please sign in to comment.