I have some search models in legacy code that are using closures. Worked fine until update on 2.0.51-dev
What is the expected result?
Search model contains something like
$query = User::find();
$dataProvider = new ActiveDataProvider([
'query' => $query,
]);
// confederationId
if ($this->confederationId) {
$query->joinWith(['userProfile' => function ($q) {
$q->andFilterWhere(['user_profiles.confed_id' => $this->confederationId]);
}]);
}
expected search query to be extended and search by e.g. "confederationId"
What do you get instead?
Exception
Serialization of 'Closure' is not allowed
1. in ..../releases/893/vendor/yiisoft/yii2/db/Query.php at line 1399
139013911392139313941395139613971398139914001401 ]);
}
/**
* Returns the SQL representation of Query
* @return string
*/
public function __toString()
{
return serialize($this);
}
}
What steps will reproduce the problem?
I have some search models in legacy code that are using closures. Worked fine until update on 2.0.51-dev
What is the expected result?
Search model contains something like
expected search query to be extended and search by e.g. "confederationId"
What do you get instead?
Additional info
In 2.0.50
seems not to be used?