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

Caching issue when list view is initially called without filter #12

Open
mmunz opened this issue Oct 25, 2022 · 3 comments
Open

Caching issue when list view is initially called without filter #12

mmunz opened this issue Oct 25, 2022 · 3 comments

Comments

@mmunz
Copy link

mmunz commented Oct 25, 2022

In ext_localconf.php the list action is added to the list of non-cachable actions only when a search POST var is set:

$vars = \TYPO3\CMS\Core\Utility\GeneralUtility::_POST('tx_news_pi1');
if (isset($vars['search']) && is_array($vars['search'])) {
    $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['extbase']['extensions']['News']['plugins']['Pi1']['controllers'][\GeorgRinger\News\Controller\NewsController::class]['nonCacheableActions'][] = 'list';
}

Because ext_localconf.php is only called once and then cached this leads to caching issues, when the list page with filters is initially called without any filter, because the list action is not added to the list of uncachable actions and filters do not work.

@mmunz
Copy link
Author

mmunz commented Oct 25, 2022

Unfortunately i currently have no idea how to properly fix this, but if Georg or someone else has any suggestions i could try to fix it and create an PR.

@klodeckl
Copy link

Same here. It is not the best solution but I fixed it with the following typoscript:

// Disable caching if search params set
[traverse(request.getParsedBody(), 'tx_news_pi1/search/fromDate') || traverse(request.getParsedBody(), 'tx_news_pi1/search/toDate') || traverse(request.getParsedBody(), 'tx_news_pi1/search/filteredCategories')]
temp.news < tt_content.list.20.news_pi1
tt_content.list.20.news_pi1 >
tt_content.list.20.news_pi1 = COA_INT
tt_content.list.20.news_pi1.10 < temp.news
[global]

@klodeckl
Copy link

klodeckl commented Aug 1, 2024

My solution also doesn’t work now, I don’t know why and why it has worked some time ago. When setting

[traverse(request.getParsedBody(), 'tx_news_pi1/search/subject') || traverse(request.getParsedBody(), 'tx_news_pi1/search/fromDate') || traverse(request.getParsedBody(), 'tx_news_pi1/search/toDate') || traverse(request.getParsedBody(), 'tx_news_pi1/search/filteredCategories')]
temp.news < tt_content.list.20.news_pi1
tt_content.list.20.news_pi1 >
tt_content.list.20.news_pi1 = COA_INT
tt_content.list.20.news_pi1.10 < temp.news
config.no_cache = 1
[global]

then it works (only with config.no_cache = 1 and COA_INT didn’t solve it).

A proper solution for this would be great.

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

No branches or pull requests

2 participants