Added catch `\Throwable` to be compatible with PHP7.
Added it in cases where object state needs to be kept consistent.
Mainly on transactions but also some other places where some values are
reset before exiting.
Most of them could probably be refactored by using `finally` in 2.1, as
that requires PHP 5.5.
fixes#12619
* Refactor validateAttribute method in UniqueValidator
Extract prepareParams and prepareQuery from validateAttribute,
so they can be tested separately.
* Added issue number to changelog
* Eliminated unneeded variable
* Renamed methods and parameters, update PHPDocs
* Added JS tests for yii.captcha.js (#12840), fixes#13159
* Sinon needs to be imported in similar fashion in other test files
* Added according line to CHANGELOG [skip ci]
* Update CHANGELOG.md
* Try to run tests with default timeout in Travis
* Added note about JS tests to the docs [skip ci]
* Simplified tests for multiple elements (init, destroy methods)
* 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
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
* 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
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.
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
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#12390fixes#6373close#12708