Skip to content

Conversation

@jremmurd
Copy link
Contributor

@jremmurd jremmurd commented Feb 24, 2025

This PR adds a method to exclude specific filters in the "groupByValues" logic.

There is no breaking change, its just extending the existing possibilities of adjusting the returned aggregation values.

Example:

I have 2 fields which are displayed as one filter in the frontend, lets say sale categories and regular categories. Now I want to exclude the category filter for the sale category filter and vice versa, but I do not want to exclude them for any other filter.

With the new function I now can do something like this:

    ...
    protected function groupByValuesSpecificFilterExcludes(string $fieldname, array $config): array
    {
        $currentShortFieldname = $this->getTenantConfig()->getReverseMappedFieldName($fieldname);

        // do not consider sale filters for category filter counts and vice versa
        return match ($currentShortFieldname) {
            $saleFieldName => [
                $categoriesFieldName => $categoriesFieldName
            ],
            $categoriesFieldName => [
                $saleFieldName => $saleFieldName
            ]
            default => []
        };
    }

@github-actions
Copy link

github-actions bot commented Feb 24, 2025

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@jremmurd
Copy link
Contributor Author

I have read the CLA Document and I hereby sign the CLA

@sonarqubecloud
Copy link

@ghost ghost added the Pimcore:ToDo label Mar 11, 2025
@herbertroth
Copy link
Member

@jremmurd Could you please rebase this PR to the 2.x branch? There won’t be a 1.4 release. Thanks!

@herbertroth herbertroth changed the base branch from 1.x to 2.x April 7, 2025 13:05
@fashxp
Copy link
Member

fashxp commented Apr 18, 2025

recheck

@fashxp
Copy link
Member

fashxp commented Apr 18, 2025

@jremmurd there are commits in that PR with do not belong to your github user ... eventually you need to add your new e-mail address to your github user.

@mcop1 mcop1 self-assigned this May 27, 2025
@mcop1 mcop1 closed this May 27, 2025
@mcop1 mcop1 reopened this May 27, 2025
@github-actions github-actions bot locked and limited conversation to collaborators May 27, 2025
@mcop1
Copy link
Contributor

mcop1 commented May 27, 2025

PR looks good to me. CLA check seems to be fine as well. The failing codeception tests are due to the added secrets, they should run through in the base branch once the pr was merged.
Thanks!

@mcop1 mcop1 merged commit 61fc6e2 into pimcore:2.x May 27, 2025
8 of 13 checks passed
@fashxp fashxp added this to the 2.1.0 milestone Jun 10, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants