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

fix(save-search): correct total calculation for itemtype #18376

Closed
wants to merge 2 commits into from

Conversation

MyvTsv
Copy link
Contributor

@MyvTsv MyvTsv commented Nov 22, 2024

  • I have read the CONTRIBUTING document.
  • I have performed a self-review of my code.

Description

  • It fixes !35211
  • Fix the counter in saved searches. Previously, the counter displayed the total number of all item types instead of reflecting the actual results of the search. With this fix, the counter now correctly represents the search results based on the specified criteria.

Screenshots (if appropriate):

Capture d’écran du 2024-11-25 14-37-28
Capture d’écran du 2024-11-25 14-37-56

@MyvTsv MyvTsv self-assigned this Nov 22, 2024
@MyvTsv MyvTsv requested a review from cedric-anne November 22, 2024 13:04
@MyvTsv MyvTsv marked this pull request as ready for review November 22, 2024 13:04
Copy link
Member

@cedric-anne cedric-anne left a comment

Choose a reason for hiding this comment

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

I am not sure this fix is correct. The prepareQueryToUse() method is able to handle search criteria that no longer match a valid search option, for instance a search option related to an itemtype of a plugin that is no longer active. See usage of the $enable_partial_warnings method parameter.

src/SavedSearch.php Outdated Show resolved Hide resolved
$query_tab,
$enable_partial_warnings
);
$query_tab = null;
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add tests

@cedric-anne
Copy link
Member

Replaced by #18385.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants