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

Use first limit as default in ProductFilter #2540

Open
wants to merge 1 commit into
base: 2.9
Choose a base branch
from

Conversation

fritzmg
Copy link
Contributor

@fritzmg fritzmg commented Oct 7, 2024

If you have multiple product or category filters on the page and one of the product filters has iso_enableLimit enabled then filtering might not work in general.

What happens is that you are first redirected to e.g. products?isorc=20 and then back to e.g. products?isorc=1, completely ignoring the filter configuration of the request cache ID 20. This can happen if the config ID 20 does not contain a limit from the product filter module that has iso_enableLimit enabled.

The ProductFilter module then thinks the config is wrong and executes:

} elseif ($objLimit->notIn($arrLimit)) {
// Request cache contains wrong value, delete it!
$this->blnUpdateCache = true;
Isotope::getRequestCache()->setLimitForModule(Limit::to($arrLimit[0]), $this->id);
RequestCache::deleteById(Input::get('isorc'));
} elseif (!$this->blnUpdateCache) {

This then enables $this->blnUpdateCache = true; and thus the filter will redirect to another request cache URL.

This PR fixes that by using the first limit value as the default when fetching getFirstLimitForModules() from the request cache.

@aschempp
Copy link
Member

Why are you being redirected to products?isorc=20 in the first place?

@fritzmg
Copy link
Contributor Author

fritzmg commented Oct 10, 2024

That's the normal behaviour of the filter modules. The CategoryFilter generates links like /foobar?categoryfilter=… (see here) - and these URLs then save the filter configuration into tl_iso_requestcache and then redirect to a /foobar?isorc=… URL.

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