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

Fixes problem getting the number of search results #7910

Merged

Conversation

Sesquipedalian
Copy link
Member

@Sesquipedalian Sesquipedalian commented Nov 26, 2023

Fixes #7877

Since a generator doesn't start executing its code until the first time it is asked to do so, we had to call it at least once in order to cause SearchResult::$messages_request to be set. The easiest way to do that was just to call self::$getter->current(); in order to kick off the query.

@Sesquipedalian Sesquipedalian added this to the 3.0 Alpha 1 milestone Nov 26, 2023
Copy link
Member

@jdarwood007 jdarwood007 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is what I was missing. Calling the current method to initiate the generator.

Works for me with no issue now. @Oldiesmann Can you also confirm?

@Oldiesmann
Copy link
Contributor

No errors on my end either and it returned the expected result.

@Sesquipedalian Sesquipedalian merged commit ffc976a into SimpleMachines:release-3.0 Nov 27, 2023
3 checks passed
@Sesquipedalian Sesquipedalian deleted the num_search_results branch November 27, 2023 03:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Searching causes errors
3 participants