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

Open
wants to merge 1 commit into
base: 10.0/bugfixes
Choose a base branch
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-22 12-41-50

@MyvTsv MyvTsv self-assigned this Nov 22, 2024
@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.

$query_tab,
$enable_partial_warnings
);
$params = $search::manageParams($this->getField('itemtype'), $_GET);
Copy link
Member

Choose a reason for hiding this comment

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

I do not know if this fix is correct, but it should probably set the $usesession parameter to false.

Suggested change
$params = $search::manageParams($this->getField('itemtype'), $_GET);
$params = $search::manageParams($this->getField('itemtype'), $_GET, false);

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

Successfully merging this pull request may close these issues.

2 participants