-
-
Notifications
You must be signed in to change notification settings - Fork 12
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
Losing filter data on page browsing #14
Comments
Same here. I have a jquery solution: $("ul.pagination a").click(function (e) { And you need a hidden input field: |
Hi, i have the same problem and this solution doesn't work for me. Is there another way to fix this issue? thx |
The solution for this would be to store the selected filters in a session.
Here, we need to check if we already have a filter in the session. And if so, we need to use it instead of invoking a new empty "Search" filter. // Load filter from session or create a new empty search
$request = $event->getRequest();
$frontendUser = $request->getAttribute('frontend.user');
$sessionFilter = $frontendUser->getKey('ses', 'tx_news_filter');
if ($sessionFilter) {
$sessionFilter = unserialize($sessionFilter);
$search = $this->propertyMapper->convert($sessionFilter, Search::class);
} else {
$search = GeneralUtility::makeInstance(Search::class);
}
// set a new search if a new search was submitted
$vars = GeneralUtility::_POST('tx_news_pi1');
if (isset($vars['search']) && is_array($vars['search'])) {
// serialize and save search in session
$sessionData = serialize($vars['search']);
$frontendUser->setKey('ses', 'tx_news_filter', $sessionData);
/** @var Search $search */
$search = $this->propertyMapper->convert($vars['search'], Search::class);
} However, this only handles the There's a method |
I made PR #19 to solve this problem. It works fine in my v11 project. |
@cepheiVV why do you want to store it in the session and not in form parameters? |
Beause we ain't got no form in paginated links. @klodeckl Also, you're missing the point with your jQuery solution. It's not about passing the current |
@cepheiVV Ah, sorry, you’re right. :) |
The patch does not work for me, unfortunately. It keeps the selection when using the pagination links, like it should. But for instance if I select 2 categories and then switch to page 5 and then open the same site in another browser and got to page 5 it has the selection of the first browser there, too. |
same problem here TYPO3 12.4.14 and news-fitler 2.1.0. First page is good but lost all data after |
In TYPO3 12, I have fixed issue by taking value of filteredCategory in one session custom key with pagination. |
Hi,
I think there is a problem in combination with the pagebrowser (numbered_pagination).
The filter works fine at first page. But at the second page it lost all data.
Is there a solution?
System:
TYPO3 10.4.36
News 10.0.3
News_filter 2.0.0
thx
The text was updated successfully, but these errors were encountered: