Commit Graph

8965 Commits

Author SHA1 Message Date
Alexey Rogachev
bd85b7ced2 Closes #6242: Access to validator in inline validation (#13027)
* Closes #6242: Access to validator in inline validation

* Updated PHPDoc according to PR review [skip ci]

* Imrpoved PHPDoc, updated guide info [skip ci]

* Fixes related with PR review

* Corrected CHANGELOG [skip ci]

* Update input-validation.md

added version info
2016-12-08 23:29:53 +01:00
Boudewijn Vahrmeijer
92eee10ae1 Change the name of method getQueryTableName and remove its $query argument (#12893)
* refactores getQueryTableName:
* replaces the $query argument with a $this implementation

* exposes getQueryTableName to be public instead of private. Fixes #12878

* added unit tests for exposed method

* updated changelog

* - methodname changed to 'getTableNameAndAlias'
- scope back to private
- added @internal tag to emphasize that the method is used purely for the internal workings of this piece of software.
- removed changelog (as the API has not changed)

* update tests
2016-12-08 21:22:18 +01:00
Carsten Brandt
65e4a28800 consistent behavior for Yii::$app->controller and ->action (#13167)
Fixed inconsistency, `Yii::$app->controller` is available
after handling the request since 2.0.10, this is now also the case for
`Yii::$app->controller->action`.

fixes #12795
2016-12-08 18:00:05 +01:00
Boudewijn Vahrmeijer
33c27bcf1e Update yii.php
fixes #13169
2016-12-08 16:56:39 +01:00
Nikola Kovacs
f5beaf3edf Make validator getClientOptions public
This allows implementing custom client-side validation
without extending every validator.

Fixes #11163
close #13145
2016-12-08 01:30:36 +01:00
sztyvny
6d005092ac Polish translations for field validation fix (#13153) [skip ci] 2016-12-07 15:06:09 +03:00
Carsten Brandt
48c806fe1c added unit test for DynamicModel::load()
issue #12116
2016-12-07 00:21:00 +01:00
Carsten Brandt
4735d4da6b Update DynamicModel.php
added note about limitations, i.e. no scenarios -> no safe attributes -> no load().
2016-12-07 00:08:08 +01:00
Alexey Rogachev
76e253e140 yii\validators\Validator - added separate methods for client-side validation options
Closes #11163
2016-12-05 22:33:49 +02:00
SilverFire - Dmitry Naumenko
25eafa560e Merge branch '11627-document-and-test-empty-listview' of git://github.com/mytskine/yii2 into mytskine-11627-document-and-test-empty-listview
Conflicts:
	framework/widgets/BaseListView.php
	tests/framework/widgets/ListViewTest.php
2016-12-05 22:19:02 +02:00
Boudewijn Vahrmeijer
7dac3ed1ca Kirkhansen 9053 add radio button column (#13126)
* Added the RadioButtonColumn class and updated the changelog.

* - several enhancements:
- unit tests added
- changelog fixed

* Update CHANGELOG.md

* small markdown fixes

* fix travis: custom ID
2016-12-05 13:58:11 +01:00
Robert Korulczyk
35998449eb Add yii\filters\HostControl::$fallbackHostInfo (#13117) 2016-12-03 08:25:39 +02:00
Carsten Brandt
7fead4f011 Merge pull request #12959 from yiisoft/bash-completion
Added bash completion file for ./yii commands
2016-12-03 01:25:06 +01:00
Carsten Brandt
187c44e43e implement suggestion for unknown command in console application
suggestion is based on two principles:

- first suggest commands the begin with the unknown name, to suggest
  commands after accidentally hitting enter
- second find similar commands by computing the levenshtein distance
  which is a measurement on how many changes need to be made to convert
  one string into another. This is perfect for finding typos.
2016-12-03 01:17:50 +01:00
Carsten Brandt
1d3495d84d Alternative implementation for Unknown command suggestions
alternative implementation for #12661, proof of concept, does not
include filtering by similarity yet.

issue #12659
2016-12-03 01:13:28 +01:00
SilverFire - Dmitry Naumenko
1454d3fa37 Updated CHANGELOG
fixed typo
2016-12-03 00:43:14 +01:00
SilverFire - Dmitry Naumenko
4454d05410 Added ZSH completion, moved scripts to a separate directory 2016-12-03 00:36:40 +01:00
Carsten Brandt
05b17ebb65 Added bash completion file for ./yii commands
This allows to auto-complete commands available by the `./yii`
executable on the bash by expanding the first argument with the TAB key.
E.g. Typing `./yii [TAB]` will list all commands. `./yii mig[TAB]` will
auto-complete to `./yii migrate` and tab after that will list all
migration sub-commands(actions).

fixes #475
2016-12-03 00:36:40 +01:00
Carsten Brandt
612afdbc66 Merge pull request #13111 from yiisoft/js-tests
Making JS tests ready to go into master.
2016-12-02 22:35:35 +01:00
Alexander Makarov
954c771fdb Code cleanup (#13113)
* Simplified code branching, named variable better

* More simple code cleanup

* More consistent line breaks before return statemetns
2016-12-03 00:15:53 +03:00
Boudewijn Vahrmeijer
9c0e94efea Update CHANGELOG.md
typo
2016-12-02 21:53:08 +01:00
Alexander Makarov
e1b0cb4343 Merge branch 'master' into aria-required-and-aria-invalid-input-attributes 2016-12-02 23:38:55 +03:00
Alexander Makarov
0b9feb28e5 More renaming, removed unnecessary code 2016-12-02 16:59:01 +03:00
SilverFire - Dmitry Naumenko
437825be70 Implemented Container::setDependencies(), Container::setDefinitions
Closes #11758
Closes #13029
2016-12-02 15:08:24 +02:00
Klimov Paul
c17766181f Added QueryInterface::emulateExecution()
Added `QueryInterface::emulateExecution()`, which allows preventing of
the actual query execution.
This allows to cancel `DataProvider` preventing search query execution
in case search model is invalid:

``` php
public function search($params)
    {
        $query = Item::find();

        $dataProvider = new ActiveDataProvider([
            'query' => $query,
        ]);

        $this->load($params);

        if (!$this->validate()) {
            $query->where('0=1');
            $query->emulateExecution(); // No SQL execution will be done
            return $dataProvider;
        }
```

This also fix unecessary query in case of `via()` usage. See #12390.

fixes #12390
fixes #6373
close #12708
2016-12-02 13:28:51 +01:00
Alexander Makarov
de4f518b94 More renaming 2016-12-02 14:38:44 +03:00
Alexander Makarov
edfbab4a6b More renaming and formatting fix 2016-12-02 14:37:13 +03:00
Alexander Makarov
dc294ba56f Renamed variables, changed logic of turning client updates on 2016-12-02 14:30:13 +03:00
Alexander Makarov
b25ebaa782 Fixed formatting 2016-12-02 13:11:34 +03:00
SilverFire - Dmitry Naumenko
9807b2e1a1 Follow-up to 65c2ade. Smarter fix of #13118 2016-12-02 10:09:08 +02:00
Boudewijn Vahrmeijer
fec8ae2e1e removed @since 2016-12-02 09:05:10 +01:00
SilverFire - Dmitry Naumenko
65c2ade8ed Fixed handleAction() function in yii.js to handle attribute data-pjax=0 as disabled PJAX
Fixes #13118
2016-12-02 10:04:59 +02:00
Alexander Makarov
ed8acc8e03 #12399 adjustments 2016-12-02 01:44:57 +03:00
a.kompaniets
fb779e3ec6 Fixes #12399: Added ActiveField::addAriaAttributes property for aria-required and aria-invalid attributes rendering 2016-12-02 01:44:34 +03:00
SG5
1141fc81a7 Fixes #12735: Fixed yii\console\controllers\MigrateController creating multiple primary keys for field bigPrimaryKey:unsigned 2016-12-02 01:03:24 +03:00
zalatov
deea3cf798 Fixes #12854: Added RangeNotSatisfiableHttpException to cover HTTP error 416 file request exceptions 2016-12-02 00:51:49 +03:00
Boudewijn Vahrmeijer
5784dd1dbf fix travis 2016-12-01 22:48:40 +01:00
Alexander Makarov
242d850d6c Shorter variable name, different approach to casting 2016-12-02 00:40:10 +03:00
Alexander Makarov
b17dfa03a2 Fixes #10488: Fixed incorrect behavior of yii\validation\NumberValidator when used with locales where decimal separator is comma 2016-12-02 00:04:55 +03:00
Vladimir Khramov
dd94ead358 Initial work on #10488 2016-12-02 00:01:51 +03:00
Boudewijn Vahrmeijer
7b3f4095c2 added @since 2016-12-01 17:57:11 +01:00
Boudewijn Vahrmeijer
d295812695 upgrade file updated 2016-12-01 17:24:41 +01:00
Boudewijn Vahrmeijer
5e12a5cc3a added spaces 2016-12-01 16:00:31 +01:00
Boudewijn Vahrmeijer
781ac2e139 add changelog 2016-12-01 16:00:06 +01:00
Boudewijn Vahrmeijer
9218adcec2 fixes after @samdark review 2016-12-01 15:34:03 +01:00
Boudewijn Vahrmeijer
7f537d684e Custom ID generation for Pjax widgets to solve unstable ajax calls (issue #12969)
Implements the solution proposed in the following comment:
https://github.com/yiisoft/yii2/pull/12977#issuecomment-260123078
2016-12-01 14:27:20 +01:00
Alexey Rogachev
8ea1f510af Implemented Javascript test suite
fixes #12840

Used @nkovacs draft as starting
point(https://github.com/yiisoft/yii2/issues/11037#issuecomment-193356450).
I also fixed some bugs in `yii.validation.js` and did some refactoring.

Implemented tests:

- yii.validation.js

Running tests:

- Install Node.js. I used the latest version available at the moment -
  `v7.1.0`. Note that used `jsdom` dependent library version requires
`Node.js >= 4`.
- Run `npm install` to install dependencies.
- Execute `npm test` for running tests.
2016-12-01 11:25:18 +01:00
Elvira Sheina
729ddc5b76 Select only primary keys in UniqueValidator (#10896) (#13098)
fixes #10896
2016-12-01 10:45:58 +01:00
Carsten Brandt
081ee7c5b1 Implemented shortcut methods for returning JSON and XML (#13101)
fixes #13036
2016-12-01 10:33:49 +01:00
Klimov Paul
7da77c3d5a created HostControl filter to prevent Host header attacks
fixes #13050
close #13063
2016-12-01 00:59:26 +01:00