mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-03 22:32:40 +08:00
Fix #18823: Rollback changes #18806 in yii\validators\ExistValidator::checkTargetRelationExistence()
This commit is contained in:
@ -4,7 +4,7 @@ Yii Framework 2 Change Log
|
||||
2.0.44 under development
|
||||
------------------------
|
||||
|
||||
|
||||
- Chg #18823: Rollback changes #18806 in `yii\validators\ExistValidator::checkTargetRelationExistence()` (WinterSilence)
|
||||
- Enh #18826: Add ability to turn the sorting off for a clicked column in GridView with multisort (ditibal)
|
||||
- Bug #18646: Remove stale identity data from session if `IdentityInterface::findIdentity()` returns `null` (mikehaertl)
|
||||
- Bug #18832: Fix `Inflector::camel2words()` adding extra spaces (brandonkelly)
|
||||
|
||||
@ -133,7 +133,9 @@ class ExistValidator extends Validator
|
||||
|
||||
$connection = $model::getDb();
|
||||
if ($this->forceMasterDb && method_exists($connection, 'useMaster')) {
|
||||
$exists = $connection->useMaster([$relationQuery, 'exists']);
|
||||
$exists = $connection->useMaster(function() use ($relationQuery) {
|
||||
return $relationQuery->exists();
|
||||
});
|
||||
} else {
|
||||
$exists = $relationQuery->exists();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user