Skip to content
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

PaginatedResponse does not have access to $this->client #30

Closed
pierrexp9 opened this issue Mar 8, 2022 · 2 comments · Fixed by #36
Closed

PaginatedResponse does not have access to $this->client #30

pierrexp9 opened this issue Mar 8, 2022 · 2 comments · Fixed by #36
Labels
documentation Improvements or additions to documentation enhancement New feature or request

Comments

@pierrexp9
Copy link
Contributor

pierrexp9 commented Mar 8, 2022

Hello MacFJA,
(I'm using version 2.1.0)

I get a

Call to a member function execute() on null
at vendor/macfja/redisearch/src/Redis/Response/PaginatedResponse.php:145

It appears that $this->client is null.

When I set the setLimit to a high enough value, I dont get this error anymore.

Another workaround is to manually set the client like this

 /** @var PaginatedResponse $results */
$results = $client->execute($search);
$results->setClient($client);
@MacFJA
Copy link
Owner

MacFJA commented Mar 12, 2022

The error you have is caused by the PaginatedResponse trying to request the next page.
But as the Search command don't know the client, so it can't give it to the response.
So you have the tell the PaginatedResponse what is the client to use.


But I guess I can make a more developer friendly error

@MacFJA MacFJA added documentation Improvements or additions to documentation enhancement New feature or request labels Mar 12, 2022
@pierrexp9
Copy link
Contributor Author

Allright, thanks for the explanation!

MacFJA added a commit that referenced this issue Apr 5, 2022
Rework paginated response (close #31)
Throw exception is client is not defined in Paginated response (close #30)
Increase the code coverage
MacFJA added a commit that referenced this issue Apr 5, 2022
Rework paginated response (close #31)
Throw exception is client is not defined in Paginated response (close #30)
Increase the code coverage
MacFJA added a commit that referenced this issue Apr 5, 2022
Rework paginated response (close #31)
Throw exception is client is not defined in Paginated response (close #30)
Increase the code coverage
MacFJA added a commit that referenced this issue Jun 6, 2022
Rework paginated response (close #31)
Throw exception is client is not defined in Paginated response (close #30)
Increase the code coverage
@MacFJA MacFJA closed this as completed in #36 Jun 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants