markocupic / contao-news-infinite-scroll-bundle

Contao 4 module: Add Infinite Scroll to the Contao Newslist Module
4 stars 1 forks source link

Error: Could not find template #17

Closed GMTeams closed 6 months ago

GMTeams commented 6 months ago

Contao 4.13.38 Contao-news-infinite-scroll-bundle: 1.4.2 PHP 8.1.27

I was updating Contao-news-infinite-scroll-bundle from 1.4.1 to 1.4.2 and now on all frontend pages there is an error. Logfile says: request.CRITICAL: Uncaught PHP Exception Exception: "Could not find template "j_news_infinite_scroll"" at /homepages/19/123/htdocs/_dev/contao/vendor/contao/core-bundle/src/Resources/contao/library/Contao/TemplateLoader.php line 156 {"exception":"[object] (Exception(code: 0): Could not find template \"j_news_infinite_scroll\" at /homepages/19/123/htdocs/_dev/contao/vendor/contao/core-bundle/src/Resources/contao/library/Contao/TemplateLoader.php:156)"} []

I have switched back to 1.4.1 and the error is gone. Thank you.

markocupic commented 6 months ago

@GMTeams Are you using a custom template js_news_infinite_scroll in your layout? You have probably set the wrong file name. The file name is not "j_news_infinite_scroll", but "js_news_infinite_scroll".

GMTeams commented 6 months ago

Okay thanks, but I'm not using a custom template js_news_infinite_scroll or j_news_infinite_scroll.

Only thing which catches my attention is in the page layout, there is a jQuery Template "j_news_infinite_scroll" connected. I want to point out that this is not named as "js_news_infinite_scroll" but this should not be the problem.

But now I know the problem is the reference to this wrong (old) file name, with this information I can further investigate this in my system. Maybe there is a reference somewhere which has to be updated.

Thank you.

rainermueller commented 5 months ago

We have the same issue with 1.4.1 to 1.4.2 upgrade. There is no layout template used.

Reverted back to 1.4.1 works again.

rabauss commented 5 months ago

I think the problem is that version 1.4.2 is based on 2.x - so semantic versioning is not correct!

markocupic commented 5 months ago

@rabauss @rainermueller @GMTeams Perhaps this is the cause. I've renamed the branch to 1.x. Does the error still occurs?

rainermueller commented 5 months ago

Version 1.4.2 / 1.4.3 shows no errors in /var/logs or browser console, but pagination is not replaced with infinite scroll. @rainermueller Contao version?

rabauss commented 5 months ago

As long as the changes from last year are included in 1.x only the renaming won't solve the problem. see: https://github.com/markocupic/contao-news-infinite-scroll-bundle/compare/1.4.1...1.4.3

The 1.x has to be copied as 2.x Then the 1.x has to be reset to 1.4.1 and the last changes from 2024 should be cherry-picked from 2.x - afterwards new tag has to be set on 1.x