-
-
Notifications
You must be signed in to change notification settings - Fork 252
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Infinite query loop "ActiveDataProvider" when the index does not exist #134
Labels
Milestone
Comments
Thanks for posting in our issue tracker.
Thanks! This is an automated comment, triggered by adding the label |
code exemple: $provider = new ActiveDataProvider([
'query' => Entry::find(),
'pagination' => [
'pageSize' => 10,
]
]);
return $this->render('index', ['models' => $provider->getModels()]); if the index doesn't exist, the page hangs up because "getQueryResult" expects array but public function getQueryResults()
{
if (!is_array($this->_queryResults)) {
$this->prepare();
}
return $this->_queryResults;
} |
ghost
mentioned this issue
Jan 3, 2019
samdark
added a commit
that referenced
this issue
May 1, 2019
* Update Query.php (#131) * PHPUnit compatibility, provide token for github auth * token update * yet another update * Fix #134 infinite query loop when the index does not exist * improved error message for cluster auto detection issue #137 * updated docs about cluster autodetection fixes #137 * Elasticsearch logo added to README.md * Composer json change * Added alias actions to Command * Fix for desirialization of plain response from elasticsearch * Bring back old name for package * Fix for php 5.4 * Added phpdocs, fixes and tests * CHANGELOG.md * clarify version compatibility * Fixing broken elasticsearch doc links (#144) [skip ci] * Fixes #149: Changed `yii\base\Object` to `yii\base\BaseObject` * since elasticsearch 6, content type is mandatory (#150) since elasticsearch 6, content type is mandatory. Otherwise, requests will all fail. https://www.elastic.co/blog/strict-content-type-checking-for-elasticsearch-rest-requests * added CHANGELOG for #150 * Reset query results after calling refresh() method close #125 * Fixes case (#153) [skip ci] * Fix spelling (#165) [skip ci] * fix findAll and findOne to filter input to avoid passing manipulated condition * release version 2.0.5 * prepare for next release * Update README.md * docs/guide-ja updated [ci skip] (#178) * Removed redundant line from license [skip ci] * guide-ja revised [ci skip] * Fixed `count()` compatibility with PHP 7.2 do not call it on scalar values. fixes #180 * Translate into Russian (#194) [skip ci] * Improve Russian docs (#200) [skip ci] * Bug #201: Fixed infinite loop * Updated issue template [skip ci] * Made tests running again (#210) * Revert "Bug #201: Fixed infinite loop" This reverts commit aa22ffd. * Fixes #218: Comment out invalid syntax in sample [skip ci] (#219) * docs/guide-ja/mapping-indexing.md updated [ci skip] (#221) * Fixes #227: Fixed `Bad Request (#400): Unable to verify your data submission.` in debug details panel 'run query' * Travis adjustments (#228) * Use assertCount() in tests * Add missing relations to Order test model * Add note delete-by-query plugin (#158) * Fixes #117: Add support for `QueryInterface::emulateExecution()` * Specified versions that work
tunecino
added a commit
to tunecino/yii2-elasticsearch
that referenced
this issue
Jun 23, 2019
related to yiisoft#134 and yiisoft#201. There is currently an infinite loop that happens when following method is called before getting any results from ElasticSearch: ``` prepareModels() ->getPagination() ->prepareTotalCount() ->getQueryResults() ->prepare() ->prepareModels() ``` It seems the infinite loop issue has already been fixed at some point, but then reverted by yiisoft@58466a8. This PR tries a different fix to the same issue by simply ensuring `prepareTotalCount()` to request the number from the database in case we have no available query response, the exact same way it was done with core `ActiveDataProvider::prepareTotalCount()` for SQL databases, Mongo and Sphinx extensions.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What steps will reproduce the problem?
When the index does not exist and we refer to it, we get false because the expected array is trying to get data again and so infinitely
PS: Sorry for my english
Additional info
The text was updated successfully, but these errors were encountered: